# Converting RGB to HSV

**URL:** <https://discourse.nodered.org/t/converting-rgb-to-hsv/52639>\
**Category:** General\
**Created:** [24 October 2021 02:27 UTC](https://discourse.nodered.org/t/converting-rgb-to-hsv/52639 "2021-10-24T02:27:31Z")\
**Posts on this page:** 4\
**Page:** 1

<div class="post-metadata">

**Author:** ![PapaZ](https://avatars.discourse-cdn.com/v4/letter/p/a88e57/32.png) [@PapaZ](https://discourse.nodered.org/u/PapaZ)\
**Post date:** [24 October 2021 02:27 UTC](https://discourse.nodered.org/t/converting-rgb-to-hsv/52639/1 "2021-10-24T02:27:31Z")

</div>

Hello again, trying to convert RGB to HSV found two nodes which I can't get to one. One is called 'Color Converter' which is suppose to take any color input and return the values of all others. When I try that it gives me the same output as I gave input with no errors. The second one is called 'Color-Convert'. You specify an input type and the output type you want. When using input as RGB and requesting out og HSV it want's the input as an array. Using a debug module I verified my input was an array howerver it gives me an error saying it's not. Any help would be appreciated.

```auto
[{"id":"03ac9f8a4a6deca0","type":"tab","label":"Flow 4","disabled":false,"info":""},{"id":"61d7519e0b341ef0","type":"debug","z":"03ac9f8a4a6deca0","name":"","active":true,"tosidebar":true,"console":false,"tostatus":false,"complete":"rbg_color","targetType":"msg","statusVal":"","statusType":"auto","x":1080,"y":260,"wires":[]},{"id":"1bd29a7dbb7fe978","type":"node-red-contrib-colorspace","z":"03ac9f8a4a6deca0","name":"ColorConvert","target":"payload","x":850,"y":260,"wires":[["61d7519e0b341ef0"]]},{"id":"ce91659ea4e30aec","type":"color-convert","z":"03ac9f8a4a6deca0","input":"rgb","output":"hsv","outputType":"array","scaleInput":false,"x":860,"y":320,"wires":[["61d7519e0b341ef0"]]},{"id":"85d28496a14d1f0d","type":"inject","z":"03ac9f8a4a6deca0","name":"","props":[{"p":"payload"},{"p":"topic","vt":"str"}],"repeat":"","crontab":"","once":false,"onceDelay":0.1,"topic":"","payloadType":"date","x":380,"y":320,"wires":[["c27a5a0b1b42dbf0"]]},{"id":"c27a5a0b1b42dbf0","type":"change","z":"03ac9f8a4a6deca0","name":"","rules":[{"t":"set","p":"rbg_color","pt":"msg","to":"{\"rgb\":[0,255,0]}","tot":"json"}],"action":"","property":"","from":"","to":"","reg":false,"x":590,"y":320,"wires":[["0b21b8d3f22ab435","ce91659ea4e30aec"]]},{"id":"0b21b8d3f22ab435","type":"debug","z":"03ac9f8a4a6deca0","name":"","active":true,"tosidebar":true,"console":false,"tostatus":false,"complete":"rbg_color","targetType":"msg","statusVal":"","statusType":"auto","x":780,"y":400,"wires":[]}]

```

---

<div class="post-metadata">

**Author:** ![HaroldPetersInskipp](https://sea2.discourse-cdn.com/flex026/user_avatar/discourse.nodered.org/haroldpetersinskipp/32/42319_2.png) [@HaroldPetersInskipp](https://discourse.nodered.org/u/HaroldPetersInskipp)\
**Post date:** [24 October 2021 04:34 UTC](https://discourse.nodered.org/t/converting-rgb-to-hsv/52639/4 "2021-10-24T04:34:49Z")

</div>

I use `node-red-contrib-chroma` and It should work for this

---

<div class="post-metadata">

**Author:** ![HaroldPetersInskipp](https://sea2.discourse-cdn.com/flex026/user_avatar/discourse.nodered.org/haroldpetersinskipp/32/42319_2.png) [@HaroldPetersInskipp](https://discourse.nodered.org/u/HaroldPetersInskipp)\
**Post date:** [24 October 2021 04:43 UTC](https://discourse.nodered.org/t/converting-rgb-to-hsv/52639/5 "2021-10-24T04:43:03Z")

</div>

Here is an example with it:

```auto
[{"id":"61d7519e0b341ef0","type":"debug","z":"03ac9f8a4a6deca0","name":"","active":true,"tosidebar":true,"console":false,"tostatus":false,"complete":"true","targetType":"full","statusVal":"","statusType":"auto","x":570,"y":40,"wires":[]},{"id":"85d28496a14d1f0d","type":"inject","z":"03ac9f8a4a6deca0","name":"","props":[{"p":"payload"}],"repeat":"","crontab":"","once":false,"onceDelay":0.1,"topic":"","payloadType":"str","x":110,"y":40,"wires":[["c27a5a0b1b42dbf0"]]},{"id":"c27a5a0b1b42dbf0","type":"change","z":"03ac9f8a4a6deca0","name":"","rules":[{"t":"set","p":"payload","pt":"msg","to":"{\"r\": 0, \"g\": 255, \"b\": 0}","tot":"json"}],"action":"","property":"","from":"","to":"","reg":false,"x":260,"y":40,"wires":[["0b21b8d3f22ab435","e10d42f1e1a3c39c"]]},{"id":"0b21b8d3f22ab435","type":"debug","z":"03ac9f8a4a6deca0","name":"","active":true,"tosidebar":true,"console":false,"tostatus":false,"complete":"true","targetType":"full","statusVal":"","statusType":"auto","x":390,"y":120,"wires":[]},{"id":"e10d42f1e1a3c39c","type":"chroma","z":"03ac9f8a4a6deca0","name":"","outFormat":"hsv","array2object":true,"floatOutput":true,"inputRelativeValues":"percent","outputRelativeValues":"percent","x":440,"y":40,"wires":[["61d7519e0b341ef0"]]}]

```

Its the same as yours but using msg.payload as the variable

---

<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:** [23 December 2021 04:43 UTC](https://discourse.nodered.org/t/converting-rgb-to-hsv/52639/6 "2021-12-23T04:43:35Z")

</div>

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