# Background color not changing with property binding

**URL:** <https://forum.inductiveautomation.com/t/background-color-not-changing-with-property-binding/85339>\
**Category:** Ignition\
**Tags:** perspective\
**Created:** [February 7, 2024, 1:03am UTC](https://forum.inductiveautomation.com/t/background-color-not-changing-with-property-binding/85339 "2024-02-07T01:03:13Z")\
**Posts on this page:** 4\
**Page:** 1

<div class="post-metadata">

**Author:** ![jrd](https://avatars.discourse-cdn.com/v4/letter/j/b9bd4f/32.png) [@jrd](https://forum.inductiveautomation.com/u/jrd)\
**Post date:** [February 7, 2024, 1:03am UTC](https://forum.inductiveautomation.com/t/background-color-not-changing-with-property-binding/85339/1 "2024-02-07T01:03:13Z")

</div>

I have a perspective view that has a check box (plus other stuff) on it.  
I would like the background color of the view to change, depending on the checked status of the checkbox.  
I added 'background color' in the styles config of the view's root. When I change the color in the designer, the background color of the view changes. All good.  
Then I added a binding to this property. The binding is:

```auto
if({./Checkbox.props.selected}, color(255,0,0), color(0,255,0))

```

When I toggle the checkbox, the color in the property editor (the little indicator box beside the attribute) changes color correctly. All good.  
BUT  
the background of the view does not change

So, the background color changes without binding, and the binding seems to work based on the indicator. But when the binding is in place the background color of the view does not change  
(hope I explained that ok)

Any ideas?

---

<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:** [February 7, 2024, 1:56am UTC](https://forum.inductiveautomation.com/t/background-color-not-changing-with-property-binding/85339/2 "2024-02-07T01:56:32Z")

</div>

The `color()` expression function yields java colors, not web colors. Use strings with web colors in your expression.

---

<div class="post-metadata">

**Author:** ![jrd](https://avatars.discourse-cdn.com/v4/letter/j/b9bd4f/32.png) [@jrd](https://forum.inductiveautomation.com/u/jrd)\
**Post date:** [February 7, 2024, 4:42am UTC](https://forum.inductiveautomation.com/t/background-color-not-changing-with-property-binding/85339/3 "2024-02-07T04:42:48Z")

</div>

That works!

Thanks Phil

---

<div class="post-metadata">

**Author:** ![Transistor](https://sea1.discourse-cdn.com/inductiveautomation/user_avatar/forum.inductiveautomation.com/transistor/32/3380_2.png) [@Transistor](https://forum.inductiveautomation.com/u/Transistor)\
**Post date:** [February 7, 2024, 10:09am UTC](https://forum.inductiveautomation.com/t/background-color-not-changing-with-property-binding/85339/4 "2024-02-07T10:09:36Z")

</div>

Don't forget to hit the **Solution** button below Phil's answer.
