# Expression script question with colours

**URL:** <https://forum.inductiveautomation.com/t/expression-script-question-with-colours/66120>\
**Category:** Ignition\
**Tags:** vision, perspective\
**Created:** [November 4, 2022, 9:17am UTC](https://forum.inductiveautomation.com/t/expression-script-question-with-colours/66120 "2022-11-04T09:17:17Z")\
**Posts on this page:** 4\
**Page:** 1

<div class="post-metadata">

**Author:** ![Ben\_Lindner](https://avatars.discourse-cdn.com/v4/letter/b/ea5d25/32.png) [@Ben\_Lindner](https://forum.inductiveautomation.com/u/Ben_Lindner)\
**Post date:** [November 4, 2022, 9:17am UTC](https://forum.inductiveautomation.com/t/expression-script-question-with-colours/66120/1 "2022-11-04T09:17:17Z")

</div>

hello,

In vision you could bind to a color property and change it with

case(  
{[Sample\_Tags]OPC Custom Tags/Cond1Running}, // value  
1, // case 1  
color (0,0,0), // return 1  
color (92,89,89)) // default

How do i do the same binding to a property in perspective? In the property editor i have bound the above case situation to Props\>TextStyle\>color but obviously doesnt work.

Whats the correct syntax to bind to a property in perspective

Thanks

---

<div class="post-metadata">

**Author:** ![Gaurav.Shitole](https://sea1.discourse-cdn.com/inductiveautomation/user_avatar/forum.inductiveautomation.com/gaurav.shitole/32/72050_2.png) [@Gaurav.Shitole](https://forum.inductiveautomation.com/u/Gaurav.Shitole)\
**Post date:** [November 4, 2022, 9:51am UTC](https://forum.inductiveautomation.com/t/expression-script-question-with-colours/66120/2 "2022-11-04T09:51:10Z")

</div>

Convert that RGB color to hex.

So instead of color(0,0,0) you would write “#000000” likewise

---

<div class="post-metadata">

**Author:** ![Ben\_Lindner](https://avatars.discourse-cdn.com/v4/letter/b/ea5d25/32.png) [@Ben\_Lindner](https://forum.inductiveautomation.com/u/Ben_Lindner)\
**Post date:** [November 4, 2022, 9:58am UTC](https://forum.inductiveautomation.com/t/expression-script-question-with-colours/66120/3 "2022-11-04T09:58:05Z")

</div>

yea makes sense.

Cheers it worked.

---

<div class="post-metadata">

**Author:** ![victordcq](https://avatars.discourse-cdn.com/v4/letter/v/f6c823/32.png) [@victordcq](https://forum.inductiveautomation.com/u/victordcq)\
**Post date:** [November 4, 2022, 10:38am UTC](https://forum.inductiveautomation.com/t/expression-script-question-with-colours/66120/4 "2022-11-04T10:38:07Z")

</div>

Css can also do a string like this `"rgb(250,0,0)"`

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