You have below options:
Use a custom user control where you get the UPS property & based on the value register a script using
ScriptManager.RegisterStartUp
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
$(".classNameofTopBar").css({background-color: Red});
Alternatively you can add a CSS reference from your code
https://stackoverflow.com/questions/2943037/adding-stylesheets-programmatically-in-asp-net
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.
http://chrisstahl.wordpress.com/2012/12/21/user-information-in-sharepoint-2010-with-help-of-the-spcwc-control/