# toColor

**URL:** <https://forum.inductiveautomation.com/t/tocolor/5702>\
**Category:** Ignition\
**Created:** [January 18, 2013, 10:01pm UTC](https://forum.inductiveautomation.com/t/tocolor/5702 "2013-01-18T22:01:53Z")\
**Posts on this page:** 3\
**Page:** 1

<div class="post-metadata">

**Author:** ![mcgheeiv](https://avatars.discourse-cdn.com/v4/letter/m/71c47a/32.png) [@mcgheeiv](https://forum.inductiveautomation.com/u/mcgheeiv)\
**Post date:** [January 18, 2013, 10:01pm UTC](https://forum.inductiveautomation.com/t/tocolor/5702/1 "2013-01-18T22:01:53Z")

</div>

The failover does not seem to work for toColor in 7.5.4.

This works fine:

```auto
toColor({Root Container.lotWrapCode.data}[{Root Container.lotWrapCode.selectedRow},"ColorCode"])
```

This does not:

```auto
toColor({Root Container.lotWrapCode.data}[{Root Container.lotWrapCode.selectedRow},"ColorCode"],"black")
```

---

<div class="post-metadata">

**Author:** ![James.Lorenz](https://sea1.discourse-cdn.com/inductiveautomation/user_avatar/forum.inductiveautomation.com/james.lorenz/32/3290_2.png) [@James.Lorenz](https://forum.inductiveautomation.com/u/James.Lorenz)\
**Post date:** [January 19, 2013, 12:46am UTC](https://forum.inductiveautomation.com/t/tocolor/5702/2 "2013-01-19T00:46:06Z")

</div>

Did you get an error when using the failover? It looks like that expression isn’t casting the failover as a Color when returning it, I’ll put in a bug ticket for this issue. You can cast that string as a toColor() as a workaround for now:

```auto
toColor({Root Container.lotWrapCode.data}[{Root Container.lotWrapCode.selectedRow},"ColorCode"],toColor("black"))
```

---

<div class="post-metadata">

**Author:** ![mcgheeiv](https://avatars.discourse-cdn.com/v4/letter/m/71c47a/32.png) [@mcgheeiv](https://forum.inductiveautomation.com/u/mcgheeiv)\
**Post date:** [January 19, 2013, 8:12pm UTC](https://forum.inductiveautomation.com/t/tocolor/5702/3 "2013-01-19T20:12:08Z")

</div>

Thanks! Sometimes obvious workarounds can be difficult to see.
