I’m trying to create some text in a rectangle and I would like that the colour change basing on the value.
I’ve been trying to use the enumeration function but I can’t get it to work.
I create the enumeration and then I use it with table or a “number” function. I can’t let it work.
First, what kind of UI control did you use? Only Text, Image, and Grid have a Color Channel. It will not work with Simple Indicator UI control.
I’m attaching an example project showing how to change the color of the text.
You can use Channel Simulator to test. Please set n_state to 0, 1, 2 to show different colors of the text.
[EDITED: updated the screenshot and the attached file]
Sure. You need to create an additional table. And put a table name in the Color Channel of a Text.
This is what I already tried to do. It seems correct but the colour doesn’t change as the ecu.ambientAirTemp (channel we are using for example) value change.
OK, I tried it out, and it’s not really working.
I was using ecu.clt as example. The Color channel only does 0-1, 1 is always red, 0 is white (or maybe the set color of the text).
What am I missing? The above table is just a 0-1 function, the additional values don’t change the colors, and the color obviously has only 1 shade. the above table is misleading, as it let’s you configure a whole range with a color range, but the results on ADU is just a 0-1 red color function.
Any tips?
i tried it on ADU, but now I checked your example file.
I see how it works now, but it’s a very weird and inefficent way of doing things.
Define a table, which gives you a value for your input channel, than assign an enumeration to those values, and the enumeration is the only thing, which can have color values. well…
specially given how limited the number of enumeration items and functions in memory are.
Still, thanks!
Now i understand, but IMHO the color channel logic needs a big overhaul