Hello there, I'm very new to Ignition and have run into a problem. I'm trying to change the color of a cylindrical tank depending on an input (rgb values). I've bound the property to an expression that correctly updates when viewed in the editor, but the tank itself never changes color unless I set it manually in the selector. Is there any way around this or is that just how the tank is implemented?
Thanks
Show the expression you are using to return the color and how you have configured the binding.
Its an expression binding:
color({../NumberEntry_Red.props.value},{../NumberEntry_Green.props.value},{../NumberEntry_Blue.props.value})
When viewed in the perspective property editor its shows java.awt.Color[r=255,g=255,b=0], along with the correct color.
I think it needs to be string not a java.awt.Color
. Try this
stringFormat(
'#%02X%02X%02X',
{../NumberEntry_Red.props.value},
{../NumberEntry_Green.props.value},
{../NumberEntry_Blue.props.value}
)
1 Like
The color()
expression is incompatible with perspective. You need to have the expression provide either the hexadecimal code, or a CSS color function string.
That worked perfectly, thanks a ton!
Mark as solution
2 Likes
Sorry! First time posting.
1 Like
for perspective the string rgb(255,255,0)
would also work