morzzz007 / node-tradfri

Node API to control IKEA Tradfri Lights
MIT License
49 stars 17 forks source link

Added support for colorX and colorY parameters. #13

Closed Thorinair closed 6 years ago

Thorinair commented 6 years ago

A very simple update/change adding two more parameters (colorX and colorY) which the lamps use for the xyY color format, allowing for much finer control over the color. By default, the lamps will only accept the hex codes which are predefined as presets by Ikea, but this allows for a much wider range of colors.

LinusU commented 6 years ago

This is very interesting. How do you use these values?

Thorinair commented 6 years ago

The values correspond to the X and Y coordinates in a diagram like this for the xyY color space: image The values can range from 0 to 65535 (so generally, a bit of math is required to get the correct value to fit in the graph) for both X and Y. I am already using a fork with these changes in my project. It is used exactly the same as other parameters like status, color, brightness etc are used currently.

morzzz007 commented 6 years ago

This is awesome, thank you! I'll update the readme and release a new version soon