# Color Change of Rectangle IF statement

**URL:** <https://forum.inductiveautomation.com/t/color-change-of-rectangle-if-statement/23424>\
**Category:** General Discussion\
**Created:** [March 18, 2019, 5:58pm UTC](https://forum.inductiveautomation.com/t/color-change-of-rectangle-if-statement/23424 "2019-03-18T17:58:17Z")\
**Posts on this page:** 3\
**Page:** 1

<div class="post-metadata">

**Author:** ![justin.huggins](https://avatars.discourse-cdn.com/v4/letter/j/d07c76/32.png) [@justin.huggins](https://forum.inductiveautomation.com/u/justin.huggins)\
**Post date:** [March 18, 2019, 5:58pm UTC](https://forum.inductiveautomation.com/t/color-change-of-rectangle-if-statement/23424/1 "2019-03-18T17:58:17Z")

</div>

I am trying to change the color of a rectangle based off the value of another label string value in the same template. Right now I have tried setting up the script based off a property change, but does not seem to work. I tried setting an expression under the binding of the rectangle fillpaint but did not like my syntax. I am pretty new to this and am obviously doing something wrong. Any help would be great.

```auto
if event.source.parent.getComponent('CurStatusV3Val').text == "3":
	event.source.fillPaint == '0,255,0'

```

---

<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:** [March 18, 2019, 6:08pm UTC](https://forum.inductiveautomation.com/t/color-change-of-rectangle-if-statement/23424/2 "2019-03-18T18:08:43Z")

</div>

You seem to be trying to use python where Ignition’s expression language is expected. Try this:

```auto
if({Root Container.CurStatusV3Val.text}="3", "0,255,0", "0,0,0")

```

---

<div class="post-metadata">

**Author:** ![justin.huggins](https://avatars.discourse-cdn.com/v4/letter/j/d07c76/32.png) [@justin.huggins](https://forum.inductiveautomation.com/u/justin.huggins)\
**Post date:** [March 18, 2019, 6:15pm UTC](https://forum.inductiveautomation.com/t/color-change-of-rectangle-if-statement/23424/3 "2019-03-18T18:15:32Z")

</div>

That solved it! Thanks, exactly what I needed.
