# Tis nearly season to be jolly

**URL:** <https://discourse.nodered.org/t/tis-nearly-season-to-be-jolly/102259>\
**Category:** General\
**Created:** [26 November 2026 20:51 UTC](https://discourse.nodered.org/t/tis-nearly-season-to-be-jolly/102259 "2026-11-26T20:51:01Z")\
**Posts on this page:** 5\
**Page:** 1

<div class="post-metadata">

**Author:** ![cymplecy](https://sea2.discourse-cdn.com/flex026/user_avatar/discourse.nodered.org/cymplecy/32/2773_2.png) [@cymplecy](https://discourse.nodered.org/u/cymplecy)\
**Post date:** [26 November 2026 20:51 UTC](https://discourse.nodered.org/t/tis-nearly-season-to-be-jolly/102259/1 "2026-11-26T20:51:01Z")

</div>

.. so I'm after a way of converting a hex string cheerlight colour "#xxyyzz" to an array [xx2,yy2,zz2] where xx2 etc are decimal versions of xx etc

This is for some Wiz RGB lights

Preferably using core or contrib nodes of course 🙂

---

<div class="post-metadata">

**Author:** ![marcus-j-davies](https://sea2.discourse-cdn.com/flex026/user_avatar/discourse.nodered.org/marcus-j-davies/32/103435_2.png) [@marcus-j-davies](https://discourse.nodered.org/u/marcus-j-davies)\
**Post date:** [26 November 2026 21:28 UTC](https://discourse.nodered.org/t/tis-nearly-season-to-be-jolly/102259/2 "2026-11-26T21:28:00Z")

</div>

Hi @cymplecy

Using my basic understanding of `parseInt` (which accepts hex values)

```auto
const hex = msg.payload.replace('#', '');

msg.payload = [
    parseInt(hex.substring(0, 2), 16),
    parseInt(hex.substring(2, 4), 16),
    parseInt(hex.substring(4, 6), 16)
];
return msg;

```

there might be a way in the `change` node using `j;` - but that's above my pay grade.. perhaps @E1cid 😃

Side Note: does this mean we will see an outdoor button this year 😉

---

<div class="post-metadata">

**Author:** ![E1cid](https://sea2.discourse-cdn.com/flex026/user_avatar/discourse.nodered.org/e1cid/32/77971_2.png) [@E1cid](https://discourse.nodered.org/u/E1cid)\
**Post date:** [26 November 2026 23:35 UTC](https://discourse.nodered.org/t/tis-nearly-season-to-be-jolly/102259/3 "2026-11-26T23:35:36Z")

</div>

Ugly but

```auto
$match( $substringAfter($$.payload,"#"),
    /[0-9a-fA-F]{2}/).
    $number("0x" & $.match)

```

or simple and cleaner

```auto
[
    $number("0x" & $substring($$.payload,1,2)),
    $number("0x" & $substring($$.payload,3,2)),
    $number("0x" & $substring($$.payload,5,2))
]

```

---

<div class="post-metadata">

**Author:** ![cymplecy](https://sea2.discourse-cdn.com/flex026/user_avatar/discourse.nodered.org/cymplecy/32/2773_2.png) [@cymplecy](https://discourse.nodered.org/u/cymplecy)\
**Post date:** [27 November 2026 07:37 UTC](https://discourse.nodered.org/t/tis-nearly-season-to-be-jolly/102259/4 "2026-11-27T07:37:24Z")

</div>

![image](https://us1.discourse-cdn.com/flex026/uploads/nodered/original/3X/2/7/2720c9cb069e4eb2860c2bf1e053754481cdab5b.png)

Lovely thanks 🙂

---

<div class="post-metadata">

**Author:** ![cymplecy](https://sea2.discourse-cdn.com/flex026/user_avatar/discourse.nodered.org/cymplecy/32/2773_2.png) [@cymplecy](https://discourse.nodered.org/u/cymplecy)\
**Post date:** [27 November 2026 07:38 UTC](https://discourse.nodered.org/t/tis-nearly-season-to-be-jolly/102259/5 "2026-11-27T07:38:14Z")

</div>

Button box should be in action again (but not found where I put it yet!) 🙂
