# Colour picker weirdness

**URL:** <https://discourse.nodered.org/t/colour-picker-weirdness/43688>\
**Category:** Dashboard\
**Created:** [5 April 2021 09:30 UTC](https://discourse.nodered.org/t/colour-picker-weirdness/43688 "2021-04-05T09:30:15Z")\
**Posts on this page:** 4\
**Page:** 1

<div class="post-metadata">

**Author:** ![Garug](https://avatars.discourse-cdn.com/v4/letter/g/13edae/32.png) [@Garug](https://discourse.nodered.org/u/Garug)\
**Post date:** [5 April 2021 09:30 UTC](https://discourse.nodered.org/t/colour-picker-weirdness/43688/1 "2021-04-05T09:30:15Z")

</div>

I am trying to use colour picker but find some weird behaviour.

I want to have colour wheel and transparency slider only. Why does the rgba come rgb only when 'a' = 1 ?(see the bottom right corner.

why the minimum red, green and blue values are 16, not 0.

what should be the center value of RGB, 127? but it is not?

the 'Show lightness slider' is always auto selected when opening the configuration dialog.

 ![Screenshot 2021-04-05 at 12.23.35](https://us1.discourse-cdn.com/flex026/uploads/nodered/original/3X/1/e/1ea539c7018eedd4d615f62a95e51066f70fbfe2.jpeg)

---

<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:** [5 April 2021 20:00 UTC](https://discourse.nodered.org/t/colour-picker-weirdness/43688/2 "2021-04-05T20:00:46Z")

</div>

> [@Garug](#):
>
> Why does the rgba come rgb only when 'a' = 1

That is happening because of the tinycolor library which if you ask the string representation of rgb color, it omits the alpha in case of alpha = 1

And actually the node does not allow to configure rgba so rgb will be correct output in this case.

No workaround for the case, but you can set the output payload to be an object.  
 ![image](https://us1.discourse-cdn.com/flex026/uploads/nodered/original/3X/e/5/e5450c2069f9a024cf604c119575dcfdb7a65caf.png)

> [@Garug](#):
>
> why the minimum red, green and blue values are 16, not 0.

Can't reproduce this anyhow.

> [@Garug](#):
>
> the 'Show lightness slider' is always auto selected when opening the configuration dialog.

That seems to be bug.

---

<div class="post-metadata">

**Author:** ![Garug](https://avatars.discourse-cdn.com/v4/letter/g/13edae/32.png) [@Garug](https://discourse.nodered.org/u/Garug)\
**Post date:** [5 April 2021 20:18 UTC](https://discourse.nodered.org/t/colour-picker-weirdness/43688/3 "2021-04-05T20:18:35Z")

</div>

I ended using HEX8, it always provides rgba

The 16 offset of the colours was because of lightness slider I think.

---

<div class="post-metadata">

**Author:** ![system](https://us1.discourse-cdn.com/flex026/uploads/nodered/original/1X/d073cd938eafa2e558d7c2cd59003b3ef4963033.png) [@system](https://discourse.nodered.org/u/system)\
**Post date:** [5 May 2021 20:18 UTC](https://discourse.nodered.org/t/colour-picker-weirdness/43688/4 "2021-05-05T20:18:48Z")

</div>

This topic was automatically closed 30 days after the last reply. New replies are no longer allowed.
