soloam / node-red-contrib-colorspace

Nodered node to convert color
MIT License
2 stars 2 forks source link

Add RGBW Support #4

Closed deggle closed 2 years ago

deggle commented 2 years ago

Would it be possible to add RGBW support? I'm looking to use the conversion for LED lighting and this would be really helpful. I'm not certain of the maths, but there seems to be some relevant discussion here:

https://stackoverflow.com/questions/21117842/converting-an-rgbw-color-to-a-standard-rgb-hsb-representation Also, see line 242: https://github.com/iamh2o/rgbw_colorspace_converter/blob/main/src/rgbw_colorspace_converter/colors/converters.py

It looks like the white channel is used to offset some of the scaling on the RGB, but I'm not really there with the maths side. Perhaps it makes more sense to you, and if so it could be an easy add?

Many thanks,

Tim

soloam commented 2 years ago

Hello, I'll try to take a look and get back to you!

Best regards

soloam commented 2 years ago

I just pushed a new commit to add the RGBW. This should work now. Sorry for the delay. Please test and give some feedback @deggle

deggle commented 2 years ago

Sorry for the delay, not had chance to look yet (the place I need this is a long term project, bit I do think it'll be needed). Thank you for your time on this, lots of LED fixtures tend to include W elements now so it's good to have. In fact, a future addition could be to add CCT/colour tuneable into the mix (no idea how).