# Custom icon color in dashboard switch widget

**URL:** <https://discourse.nodered.org/t/custom-icon-color-in-dashboard-switch-widget/9508>\
**Category:** Dashboard\
**Created:** [27 March 2019 18:35 UTC](https://discourse.nodered.org/t/custom-icon-color-in-dashboard-switch-widget/9508 "2019-03-27T18:35:43Z")\
**Posts on this page:** 3\
**Page:** 1

<div class="post-metadata">

**Author:** ![drmibell](https://sea2.discourse-cdn.com/flex026/user_avatar/discourse.nodered.org/drmibell/32/8424_2.png) [@drmibell](https://discourse.nodered.org/u/drmibell)\
**Post date:** [27 March 2019 18:35 UTC](https://discourse.nodered.org/t/custom-icon-color-in-dashboard-switch-widget/9508/1 "2019-03-27T18:35:44Z")

</div>

I am using the custom icon option in a dashboard switch node (`ui_switch`), and would like to be able to set the `On/Off Colour` options in a way that will work well with more than one dashboard theme, in particular the Dark theme as well as the default Light theme. I have tried an intermediate, gray color, but this makes the icon difficult to see in either theme. Can anyone think of a way to tie this color selection to the overall theme of the dashboard, or am I stuck with a color that works well in one theme and not others?

---

<div class="post-metadata">

**Author:** ![hotNipi](https://sea2.discourse-cdn.com/flex026/user_avatar/discourse.nodered.org/hotnipi/32/383_2.png) [@hotNipi](https://discourse.nodered.org/u/hotNipi)\
**Post date:** [27 March 2019 19:18 UTC](https://discourse.nodered.org/t/custom-icon-color-in-dashboard-switch-widget/9508/2 "2019-03-27T19:18:57Z")

</div>

You can send `ui_control` object to the `ui_switch` node.

`msg.ui_control = {onicon:"fa-fire",oncolor:"orange",officon:"fa-fire",offcolor:"yellow"}`

The colors unfortunately I guess you can't get from theme directly. Probably best way is to store set of color values in flow or globally if needed more than one place and then figure out some logic to choose between sets to get chosen colors into incoming message for `ui_switch` node

---

<div class="post-metadata">

**Author:** ![drmibell](https://sea2.discourse-cdn.com/flex026/user_avatar/discourse.nodered.org/drmibell/32/8424_2.png) [@drmibell](https://discourse.nodered.org/u/drmibell)\
**Post date:** [27 March 2019 19:34 UTC](https://discourse.nodered.org/t/custom-icon-color-in-dashboard-switch-widget/9508/3 "2019-03-27T19:34:07Z")

</div>

Thanks, @hotNipi. That's a big step in the right direction. It also reminds me how much documentation I've read, never used, and promptly forgotten... 🙂
