MariusRumpf / node-lifx

Node.js implementation of the LIFX LAN protocol :bulb:
MIT License
144 stars 28 forks source link

color: rgb hex enhancement. #28

Closed roccomuso closed 7 years ago

roccomuso commented 8 years ago

wouldn't be useful to improve the .color method to make the use of RGB hex possible?

MariusRumpf commented 8 years ago

There is also a rgbw method provided by the LIFX lights. That might also be a nice thing.

roccomuso commented 8 years ago

I didn't found it on their documentation (can you link it to me?). I might work on this ;)

MariusRumpf commented 8 years ago

It is undocumented but I found parts of it in the old ruby-gem from LIFX and it is used in the app as well. https://github.com/LIFX/lifx-gem/search?utf8=%E2%9C%93&q=rgbw

roccomuso commented 8 years ago

I saw this: https://github.com/MariusRumpf/node-lifx/blob/master/lib/lifx/packets/setRgbw.js I'm writing a new method to use that kind of packet. Nothing else is using it right? Did you forget about it?

Moreover, this is written in their documentation: https://api.developer.lifx.com/docs/colors Am I wrong or do they accept an RGB format?

MariusRumpf commented 8 years ago

Oh, didn't know I had worked on that before, it is not used as far as I know.

That is correct, you can pass RGB to the api, there was a post on how one can convert it in the forums recently. https://community.lifx.com/t/how-to-convert-rgb-into-hsbk/1270/2

MariusRumpf commented 8 years ago

Started working on the basics since I didn't hear of any progress.

roccomuso commented 8 years ago

@MariusRumpf Sorry, quite busy in the last few months.. Are you planning to use the forgotten _setRgbw.js_ ? :)

MariusRumpf commented 8 years ago

@roccomuso No problem, no I used the hsbk methods still. I have added methods to convert rgb to hsb.

MariusRumpf commented 7 years ago

This was part of the 0.7.0 release with colorRgb and colorRgbHex.