nodered-color-converter

Conver colors in NodeRed

Usage no npm install needed!

<script type="module">
  import noderedColorConverter from 'https://cdn.skypack.dev/nodered-color-converter';
</script>

README

nodered-color-converter

Node-RED Node, that helps conver colors

nodered-color-converter imports into NodeRed the conversion from npm packages color-convert and color-temperature

Please note that color temperature is a extimation! It's very usefull to emulate color remperature in RGB lamps, but the values are not 100% accurate.

Install

Just run

    npm install nodered-color-converter

How to use

You can send in the payload one of the types supported by https://www.npmjs.com/package/color-convert

You can send

RGB

{
    "payload":{
        "rgb": {
            "red": 255,
            "green": 10,
            "blue": 20
        }
    }
}

HSV

{
    "payload":{
        "hsv": {
            "hue": 358,
            "staturation": 96,
            "brightness": 100
        }
    }
}

HSL

{
    "payload":{
        "hsl": {
            "hue": 358,
            "staturation": 96,
            "lightness": 52
        }
    }
}

HWB

{
    "payload":{
        "hwb": {
            "hue": 358,
            "whiteness": 4,
            "blackness": 0
        }
    }
}

CMYK

{
    "payload":{
        "cmyk": {
            "cyan": 0,
            "magenta": 96,
            "yellow": 92,
            "black": 0
        }
    }
}

CMYK

{
    "payload":{
        "xyz": {
            "x": 41,
            "y": 22,
            "z": 3
        }
    }
}

HEX

{
    "payload":{
        "hex": "FF0A14"
    }
}

Temperature

{
    "payload":{
        "temperatute": 5000
    }
}

Keyword

{
    "payload":{
        "keyword": "red"
    }
}

Direct Payload

{
    "payload": "red"
}