Page 1 of 1

Change colour of text using variables or expressions

PostPosted: Mon Dec 05, 2016 12:10 pm
by trevorsmith
I wish to display some temperture data in a text field on my CP. I wish it to be red if another variable is set to say, "true" or green if false. Is this possible?

Re: Change colour of text using variables or expressions

PostPosted: Mon Dec 05, 2016 1:10 pm
by jay (support)
No, you can only change the image represented for an element based on the value of that element.

With a lot of work, you could create a set of green images and a set of blue images and then adjust the data that's being represented to be explicit about which to use. Lots of images I'd guess though. Another option would be to display the temp value on top of another page element that shows a red/green background based on your other variable. That would be much easier.

Re: Change colour of text using variables or expressions

PostPosted: Mon Dec 05, 2016 1:40 pm
by trevorsmith
thanks.

Re: Change colour of text using variables or expressions

PostPosted: Mon Dec 05, 2016 1:58 pm
by Colorado4Wheeler
How about something like this but with your temperature in the lower middle (like a lot of digital/analog gauges) and you can change the face color from green to red? It would make for a really cool effect! This is just a screen shot from my own control page, yours might be less "retro" :)

Re: Change colour of text using variables or expressions

PostPosted: Mon Dec 05, 2016 2:25 pm
by DaveL17
There might also be elements (or at least ideas) that you can take from the WUnderground Gauge Pack.

Re: Change colour of text using variables or expressions

PostPosted: Tue Dec 06, 2016 6:54 am
by mat
Have a look at this thread. This shows a number of approaches from memory.

http://forums.indigodomo.com/viewtopic.php?f=84&t=11576

Re: Change colour of text using variables or expressions

PostPosted: Tue Dec 06, 2016 8:21 am
by Different Computers
I can also imagine doing this in Automator for the Mac using two different workflows that include the Create Banner Image from Text action. Set up two different workflows with that action to output two different graphic text files with different characteristics. Trigger them with Indigo based on whatever variable you want to use. link the output in your control page. Done.