I want to change the background and text color of the text box in the Vision template according to the tag value. In the case of one tag, I could change it with the style customizer, but I want to change the color according to the conditions of the two tags. For example, if I want to change the color of 0.0<tag1<3.0 or 3.3<tag2<5.0, where and how should I change the macro?
You could use an expression binding with and/or operators.
Example:
if (
(0.0 < {[Sample_Tags]Ramp/FloatTag.value}
&&
{[Sample_Tags]Ramp/FloatTag.value} < 3.0)
||
(3.3 < {[Sample_Tags]Ramp/FloatTag 1.value}
&&
{[Sample_Tags]Ramp/FloatTag 1.value} < 5.0),
'0,0,0',
'255,255,255'
)
1 Like
Thank you for the details. Since I'm using a template, I want to set it with the tag value using the Custom Properties I set. In a normal macro, I can write it like number = event.source.parent.number and tag as "+number+", right? I want to do that with Style Customizer, can I do it?
No, you cannot. Expressions are functions and operators only. No assignments. (The one assignment is the automatic assignment of the expression result to the bound property.)
The Style Customizer is constant values only, no expressions.
1 Like
Thank you for letting me know!