Open janmartenjongerius opened 11 years ago
Additionally you could add a translation from the current color to either color mode, through methods like:
toHSL()
toRGB()
toHexaDecimal
or, as it is the most common color in CSS, toCSS()
which has my vote against it, but there you go.If I knew how to convert RGB colors to either hue/sat or xy it would aready be in there. The Hue bridge doesn't use proper HSL as far as I understood it. The CT colormode is only for different whites. Cold (154) to warm (500). My knowledge in color stuff is very limited. I will leave this issue open and look into it! Thanks!
The official API by Philips just got released. Ars Technica has a little paragraph about the colorsettings: http://arstechnica.com/gadgets/2013/03/philips-delivers-promised-dev-docs-for-colorful-hue-led-lights/
Seems I have plans for next weekend ;-)
Have fun
On Tue, Mar 12, 2013 at 10:37 AM, sgry notifications@github.com wrote:
The official API by Philips just got released. Ars Technica has a little paragraph about the colorsettings:
Seems I have plans for next weekend ;-)
— Reply to this email directly or view it on GitHubhttps://github.com/sgry/svnhue/issues/3#issuecomment-14766045 .
Allow for colors to be values you'd enter in an image manipulation program or simple CSS stylesheets.
As far as I grasp the subject, the models already accept HSL, only by splitting off the Lightness part off as CT.
RGB and Hex (#000) colors can be translated to HSL, which in turn requires minimal translation to the native colors. Perhaps there exists a ratio between CT and L, but that's something one can look up or reverse engineer.
It would allow for the following code:
See https://github.com/sgry/svnhue/issues/2 for a reference to the structure I used in this example.