Change colour of text using variables or expressions

Posted on
Mon Dec 05, 2016 12:10 pm
trevorsmith offline
Posts: 73
Joined: Oct 08, 2016

Change colour of text using variables or expressions

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?

Posted on
Mon Dec 05, 2016 1:10 pm
jay (support) offline
Site Admin
User avatar
Posts: 14156
Joined: Mar 19, 2008
Location: Austin, Texas

Re: Change colour of text using variables or expressions

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.

Jay (Indigo Support)
Twitter | Facebook | LinkedIn

Posted on
Mon Dec 05, 2016 1:40 pm
trevorsmith offline
Posts: 73
Joined: Oct 08, 2016

Re: Change colour of text using variables or expressions

thanks.

Posted on
Mon Dec 05, 2016 1:58 pm
Colorado4Wheeler offline
User avatar
Posts: 2427
Joined: Jul 20, 2009
Location: Colorado

Re: Change colour of text using variables or expressions

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" :)
Attachments
Screen Shot 2016-12-05 at 12.56.59 PM.png
Screen Shot 2016-12-05 at 12.56.59 PM.png (148.54 KiB) Viewed 847 times

My Modest Contributions to Indigo:

HomeKit Bridge | Device Extensions | Security Manager | LCD Creator | Room-O-Matic | Smart Dimmer | Scene Toggle | Powermiser | Homebridge Buddy

Check Them Out Here

Posted on
Mon Dec 05, 2016 2:25 pm
DaveL17 offline
User avatar
Posts: 3909
Joined: Aug 20, 2013

Re: Change colour of text using variables or expressions

There might also be elements (or at least ideas) that you can take from the WUnderground Gauge Pack.

I came here to drink milk and kick ass....and I've just finished my milk.

[My Plugins] - [My Forums]

Posted on
Tue Dec 06, 2016 6:54 am
mat offline
Posts: 574
Joined: Nov 25, 2010
Location: Cambridgeshire - UK

Re: Change colour of text using variables or expressions

Have a look at this thread. This shows a number of approaches from memory.

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

mini 10.11.6

Posted on
Tue Dec 06, 2016 8:21 am
Different Computers offline
User avatar
Posts: 1744
Joined: Jan 02, 2016
Location: East Coast

Re: Change colour of text using variables or expressions

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.

SmartThings refugee, so happy to be on Indigo. 10.12.6 on an i5 MBP w/Harmony Hub, Hue, DomoPad, Dynamic URL, Device Extensions, HomeKit Bridge, MatplotLib, Plex, uniFAP, Wunderground, Nanoleaf, LED Simple Effects, Airfoil Pro, Grafana.

Page 1 of 1

Who is online

Users browsing this forum: No registered users and 1 guest