color
color copied to clipboard
Color Temperature
Hello,
We are using this library to control and visualize LED luminaries/fixtures and it has been immensely useful.
Some of our fixtures work with color temperatures instead of colors. This consists of a Kelvin temperature and a brightness. Would it be possible to implement this scale? I think it would be similar to the GRAY
method at least for the brightness part.
https://en.wikipedia.org/wiki/Color_temperature
Here is a Correlated Color Temperature (CCT) conversion example in Python (from the very popular Colour library): https://colour.readthedocs.io/en/develop/_modules/colour/temperature/hernandez1999.html
Similar to the GRAY
model, any color can be mapped/correlated to color temperature, but converting the other direction will not result in the original input.
I guess that brightness might actually be implemented as alpha? What would be most consistent with the library?
Another idea:
::color::rgb
Due to extensive calculation might be better to restrict to xyz space.
::color::xyz
Currently I stop API extension to avoid API bloating. This feature might be able to pass that restriction. I need time to think about that.
OK, let me know! I can work on a PR.
I am definitely most interested in treating it as a class/type rather than just a method, as then it will have its own memory footprint just like the others. Currently I use a template class to select the color space and then abstract out writing the channels to fixtures by index.