Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Color Temperature #10

Open
DaAwesomeP opened this issue Aug 31, 2022 · 3 comments
Open

Color Temperature #10

DaAwesomeP opened this issue Aug 31, 2022 · 3 comments

Comments

@DaAwesomeP
Copy link

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.

@DaAwesomeP
Copy link
Author

I guess that brightness might actually be implemented as alpha? What would be most consistent with the library?

@dmilos
Copy link
Owner

dmilos commented Sep 2, 2022

Another idea:
::color::rgb c;
std::cout << ::color::get::temperature( c ) << std::endl;

Due to extensive calculation might be better to restrict to xyz space.
::color::xyz x;
std::cout << ::color::get::temperature( x ) << std::endl;

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.

@DaAwesomeP
Copy link
Author

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.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants