# Change color in Vision

**URL:** <https://forum.inductiveautomation.com/t/change-color-in-vision/72178>\
**Category:** Ignition\
**Tags:** vision, ignition80\
**Created:** [April 7, 2023, 7:47am UTC](https://forum.inductiveautomation.com/t/change-color-in-vision/72178 "2023-04-07T07:47:32Z")\
**Posts on this page:** 5\
**Page:** 1

<div class="post-metadata">

**Author:** ![Mai\_Watanabe](https://avatars.discourse-cdn.com/v4/letter/m/a87d85/32.png) [@Mai\_Watanabe](https://forum.inductiveautomation.com/u/Mai_Watanabe)\
**Post date:** [April 7, 2023, 7:47am UTC](https://forum.inductiveautomation.com/t/change-color-in-vision/72178/1 "2023-04-07T07:47:32Z")

</div>

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?

---

<div class="post-metadata">

**Author:** ![justinedwards.jle](https://sea1.discourse-cdn.com/inductiveautomation/user_avatar/forum.inductiveautomation.com/justinedwards.jle/32/37854_2.png) [@justinedwards.jle](https://forum.inductiveautomation.com/u/justinedwards.jle)\
**Post date:** [April 7, 2023, 9:02am UTC](https://forum.inductiveautomation.com/t/change-color-in-vision/72178/2 "2023-04-07T09:02:32Z")

</div>

You could use an expression binding with **and/or** operators.

**Example:**

```auto
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'
	)

```

![image](https://us1.discourse-cdn.com/inductiveautomation/original/3X/4/e/4e727f0139b53591509cec7f8dd92b2f5106864e.png)

![image](https://us1.discourse-cdn.com/inductiveautomation/original/3X/c/d/cd1e5672955919f95fb1ddcb5fb5522852717b49.png)

---

<div class="post-metadata">

**Author:** ![Mai\_Watanabe](https://avatars.discourse-cdn.com/v4/letter/m/a87d85/32.png) [@Mai\_Watanabe](https://forum.inductiveautomation.com/u/Mai_Watanabe)\
**Post date:** [April 10, 2023, 1:52am UTC](https://forum.inductiveautomation.com/t/change-color-in-vision/72178/3 "2023-04-10T01:52:01Z")

</div>

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?

---

<div class="post-metadata">

**Author:** ![pturmel](https://sea1.discourse-cdn.com/inductiveautomation/user_avatar/forum.inductiveautomation.com/pturmel/32/3295_2.png) [@pturmel](https://forum.inductiveautomation.com/u/pturmel)\
**Post date:** [April 10, 2023, 2:32am UTC](https://forum.inductiveautomation.com/t/change-color-in-vision/72178/4 "2023-04-10T02:32:16Z")

</div>

> [@Mai\_Watanabe](#):
>
> 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.

---

<div class="post-metadata">

**Author:** ![Mai\_Watanabe](https://avatars.discourse-cdn.com/v4/letter/m/a87d85/32.png) [@Mai\_Watanabe](https://forum.inductiveautomation.com/u/Mai_Watanabe)\
**Post date:** [April 14, 2023, 5:39am UTC](https://forum.inductiveautomation.com/t/change-color-in-vision/72178/5 "2023-04-14T05:39:24Z")

</div>

Thank you for letting me know!
