# Changing Valve Color

**URL:** <https://forum.inductiveautomation.com/t/changing-valve-color/110427>\
**Category:** Ignition\
**Tags:** perspective\
**Created:** [September 6, 2025, 8:31am UTC](https://forum.inductiveautomation.com/t/changing-valve-color/110427 "2025-09-06T08:31:36Z")\
**Posts on this page:** 5\
**Page:** 1

<div class="post-metadata">

**Author:** ![MOHAMMED\_MUSAMMIL](https://avatars.discourse-cdn.com/v4/letter/m/f1d935/32.png) [@MOHAMMED\_MUSAMMIL](https://forum.inductiveautomation.com/u/MOHAMMED_MUSAMMIL)\
**Post date:** [September 6, 2025, 8:31am UTC](https://forum.inductiveautomation.com/t/changing-valve-color/110427/1 "2025-09-06T08:31:36Z")

</div>

Hi Guys...I have a doubt. I need to change the valve color based on the tags (Run,Fault,etc.). I'm Using nested IF expressions, but since the valve has too many elements. I can't manage it all in one expression.

---

<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:** [September 6, 2025, 10:27am UTC](https://forum.inductiveautomation.com/t/changing-valve-color/110427/2 "2025-09-06T10:27:47Z")

</div>

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

Use [binEnc | Ignition User Manual](https://docs.inductiveautomation.com/docs/8.1/appendix/expression-functions/logic/binEnc) to combine all the booleans into an integer.

Use a [Map Transform](https://docs.inductiveautomation.com/docs/8.1/ignition-modules/perspective/working-with-perspective-components/bindings-in-perspective/transforms/map-transform#expression-to-color) to convert the integer to a color. Note the Output Type setting.

---

<div class="post-metadata">

**Author:** ![MOHAMMED\_MUSAMMIL](https://avatars.discourse-cdn.com/v4/letter/m/f1d935/32.png) [@MOHAMMED\_MUSAMMIL](https://forum.inductiveautomation.com/u/MOHAMMED_MUSAMMIL)\
**Post date:** [September 6, 2025, 11:09am UTC](https://forum.inductiveautomation.com/t/changing-valve-color/110427/3 "2025-09-06T11:09:54Z")

</div>

I have a valve from Symbol Factory that consists of many individual elements. I need to change the color of the valve based on its status. Since the valve is made up of multiple elements, where should I write the expression to control the color for all elements?

 ![Valve Elements](https://us1.discourse-cdn.com/inductiveautomation/original/3X/d/9/d9cb5b6432db050838a9b1c6a3b4c1472597327e.png)

---

<div class="post-metadata">

**Author:** ![robertm](https://avatars.discourse-cdn.com/v4/letter/r/ea5d25/32.png) [@robertm](https://forum.inductiveautomation.com/u/robertm)\
**Post date:** [September 6, 2025, 12:40pm UTC](https://forum.inductiveautomation.com/t/changing-valve-color/110427/4 "2025-09-06T12:40:04Z")

</div>

Can’t speak for perspective, but in Vision, when using symbol factory symbols, I just copy the style to each sub component that needs to change color.

---

<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:** [September 6, 2025, 1:16pm UTC](https://forum.inductiveautomation.com/t/changing-valve-color/110427/5 "2025-09-06T13:16:24Z")

</div>

I haven't done it, but a quick look at the structure suggests that you need to expand each element and look for the `stopColor` value or the `fill` value. You then need to create a binding on each of these. Note that any gradient fills probably have at least three stops.

To prevent early onset madness, I suggest that you define the colors for each state as a session variable so that the color definitions can easily be redefined without having to revisit every valve. Something like:

 ![image](https://us1.discourse-cdn.com/inductiveautomation/original/3X/7/2/72cce49b7c071c0661e924f54fb084c655df895a.png)

- Then put a custom prop on the valve. e.g. 'colorPalette'.
- Add an expression binding to it to return the `{session.custom.valvePalette.open}` object when the valve is 'open', etc.
- Create a Property Binding on each of the pump SVG colors to the appropriate value. e.g.,  
`this.custom.colorPalette.solid`

It's a bit of work but you only need to do it once.

Further reading.

- [Symbol color change in perspective - #3 by cmallonee](https://forum.inductiveautomation.com/t/symbol-color-change-in-perspective/70417/3)
- [Changing multiple elements of symbol [Perspective] - #9 by victordcq](https://forum.inductiveautomation.com/t/changing-multiple-elements-of-symbol-perspective/61220/9)
-
