node-red-contrib-colorspace 1.0.2

Conver colors and colors temperature in NodeRed

npm install node-red-contrib-colorspace

node-red-contrib-colorspace

Node-RED Node, that helps conver colors

node-red-contrib-colorspace 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 temperature in RGB lamps, but the values are not 100% accurate.

Install

Just run

    npm install node-red-contrib-colorspace

Usage

This node recives any of the supported color spaces (RGB, HSV, HEX, HSL, HWB, CMYK, ANSI, XYZ, LAB, LCH, Color Name, HCG, GARY, Color Temperature) and returns all of the other)

Return

{
   "rgb":{
      "red":140,
      "green":200,
      "blue":100
   },
   "hsv":{
      "hue":96,
      "staturation":50,
      "brightness":78
   },
   "hex":"8CC864",
   "hsl":{
      "hue":96,
      "staturation":48,
      "lightness":59
   },
   "hwb":{
      "hue":96,
      "whiteness":39,
      "blackness":22
   },
   "cmyk":{
      "cyan":30,
      "magenta":0,
      "yellow":50,
      "black":22
   },
   "ansi16":93,
   "xyz":{
      "x":34,
      "y":48,
      "z":20
   },
   "lab":{
      "longitude":75,
      "latitude":-37,
      "altitude":44
   },
   "lch":{
      "lightness":75,
      "chroma":57,
      "hue":130
   },
   "keyword":"darkseagreen",
   "hcg":{
      "hue":96,
      "chroma":39,
      "grayness":65
   },
   "gray":[
      58
   ],
   "rgbi":9226340,
   "temperature":4429
}

How to use

You can send in the payload one of the types supported

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"
}

Direct Color Name in Payload

{
    "payload": "red"
}

Direct Color Temperature Name in Payload

{
    "payload": "daylight"
}

Node Info

Version: 1.0.2
Updated 1 year, 4 months ago
License: MIT
Rating: 4.0 1

Actions

Rate:

Downloads

10 in the last week

Nodes

  • node-red-contrib-colorspace

Keywords

  • color
  • converter
  • node-red
  • nodered
  • temperature
  • yeelight
  • rgb
  • hsv
  • rgbi
  • kelvin

Maintainers