I'm trying to change PS1 look based on what host I'm connected in using SSH. My current PS1:
PS1='\[\e[1;32m\]\u@\h\[\e[1;34m\] \w\[\e[1;31m\]$(__git_ps1)\[\e[1;0;37m\] \$\[\e[0m\] '
For host host1 I'd like to replace the first color with yellow which is 1;33 and for host2 take 1;35 as an example.
How can I figure out that I'm connected to the given host using SSH and alter PS1 accordingly?

if [[ -n $SSH_CLIENT ]]; then...ifcondition with your SSH colours, the second is your normal prompt.