Changing Text Color based on Value

OK all - Looking for some guidance. I'm trying to create a TEXT object for temperature and would like to change the text color based on the temperature value.

I've got what I thought should work using:

$IF(wi(temp) > 85), [c=#FF0000]wi(temp) + "*" + wi(tempu)[/c], (wi(temp) > 50), ..........

You get the idea. But, this isn't working. I get no text instead of a changing text colors based on temperature range.

Is there an easier way? A better way that I'm not considering?

thanks!

Hi,

This should work :

$if(wi(temp)>85),"[c=#FF0000]"+wi(temp)+"°"+wi(tempu)+"[/c]",wi(temp)>50,"[c=#00FF00]"+wi(temp)+"°"+wi(tempu)+"[/c]")$

You may simplify the formula like this:

$if(wi(temp)>85),"[c=#FF0000]",wi(temp)>50,"[c=#00FF00]")$$wi(temp)$°$wi(tempu)$[/c]