Customize psqlrc to be different based on host or username
You can use \gset (introduced in 9.3) to query information about the server and save it in a psql variable, then set the prompt to include that variable.

select case when inet_server_addr()='10.0.0.34' then 'PROD' else 'TEST' end as host \gset
\set PROMPT1 '%:host: %/%x%x%x%R%# '


I don't know how you get this introduce color, rather than just text, in my hands your color control sequences are just presented literally.

If you want different .psqlrc files, you have to set it as an environment variable as their is no command line option.  So something like:

alias psql_prod='PSQLRC=~/.psqlrc_prod psql'