You have below options:
Use a custom user control where you get the UPS property & based on the value register a script using
or some other way based on whether you are using Update panels in your control.
Basically you have to do below in the script file/function:
using JQuery get the top bar HTML element & set the css using
Alternatively you can add a CSS reference from your code
You must finally ensure that you have CACHING enabled for your user control as it will fire every time. You need to consider performance too and I believe the UPS property wont change that frequently.
See whether the UPS property is exposed to the OOB SharePoint property loader control. In SP 2010 we can just add a reference to OOB user control & then use it in your JS code to set the color as stated above.