# Background color change based on float value (vision) 8.1

**URL:** <https://forum.inductiveautomation.com/t/background-color-change-based-on-float-value-vision-8-1/74966>\
**Category:** General Discussion\
**Tags:** vision\
**Created:** [June 13, 2023, 4:28pm UTC](https://forum.inductiveautomation.com/t/background-color-change-based-on-float-value-vision-8-1/74966 "2023-06-13T16:28:05Z")\
**Posts on this page:** 5\
**Page:** 1

<div class="post-metadata">

**Author:** ![earnhartj84](https://sea1.discourse-cdn.com/inductiveautomation/user_avatar/forum.inductiveautomation.com/earnhartj84/32/29405_2.png) [@earnhartj84](https://forum.inductiveautomation.com/u/earnhartj84)\
**Post date:** [June 13, 2023, 4:28pm UTC](https://forum.inductiveautomation.com/t/background-color-change-based-on-float-value-vision-8-1/74966/1 "2023-06-13T16:28:05Z")

</div>

NOOB on scripting.

need help on background color change on different float value.  
On a numeric Text box or display label  
Tag \> Value = green  
Tag \< value = red.

pretty simple but cant seem to get correct syntax.  
IGN8.1 Vision.

I know it can change on abs values on the wizard ( tag property binding) but not decimals.

Thanks.

---

<div class="post-metadata">

**Author:** ![paul-griffith](https://sea1.discourse-cdn.com/inductiveautomation/user_avatar/forum.inductiveautomation.com/paul-griffith/32/37249_2.png) [@paul-griffith](https://forum.inductiveautomation.com/u/paul-griffith)\
**Post date:** [June 13, 2023, 4:49pm UTC](https://forum.inductiveautomation.com/t/background-color-change-based-on-float-value-vision-8-1/74966/2 "2023-06-13T16:49:41Z")

</div>

Style customizer?  
[https://docs.inductiveautomation.com/display/DOC81/Vision+Component+Customizers#VisionComponentCustomizers-ConfiguringtheStyleCustomizer](https://docs.inductiveautomation.com/display/DOC81/Vision+Component+Customizers#VisionComponentCustomizers-ConfiguringtheStyleCustomizer)

---

<div class="post-metadata">

**Author:** ![earnhartj84](https://sea1.discourse-cdn.com/inductiveautomation/user_avatar/forum.inductiveautomation.com/earnhartj84/32/29405_2.png) [@earnhartj84](https://forum.inductiveautomation.com/u/earnhartj84)\
**Post date:** [June 13, 2023, 4:52pm UTC](https://forum.inductiveautomation.com/t/background-color-change-based-on-float-value-vision-8-1/74966/3 "2023-06-13T16:52:59Z")

</div>

Thanks  
but i need it on a display label or numeric text box

---

<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:** [June 13, 2023, 4:57pm UTC](https://forum.inductiveautomation.com/t/background-color-change-based-on-float-value-vision-8-1/74966/4 "2023-06-13T16:57:43Z")

</div>

- Add a boolean custom property to the component you want to affect.

- Add an expression binding to that property that looks something like this:

```auto
{path/to/tag} < {path/to/limit}

```

The tag reference might be a property reference instead if you have the tag bound or indirectly bound nearby already (but not as text). Same for the limit reference, and it can be a plain constant, too.

- Use the style customizer to select your colors for the two states of the boolean, or

- Add a binding to background color and an `if()` expression to select the colors.

---

<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:** [June 14, 2023, 3:20am UTC](https://forum.inductiveautomation.com/t/background-color-change-based-on-float-value-vision-8-1/74966/5 "2023-06-14T03:20:06Z")

</div>

There are good examples of this sort of thing throughout this post:

> [@Automatic Function](https://forum.inductiveautomation.com/t/automatic-function/66619/24):
>
> For 'less than' cases the style customizer would have worked fine.
