Want to play with more temperatures than the few defined in FastLED?

Want to play with more temperatures than the few defined in FastLED? I made a kelvin temperature to rgb converter that can be used with the setTemperature() function. https://gist.github.com/smasher816/c9a668c501eb640e15b3. The code might not be the quickest due to all the powers and logs, but luckily you should only be calling this once per change (not per led) so hopefully the impact should not be too bad. I am sure many optimizations could be made knowing that the result would be stored in a uint8.

Based upon one of the only equations I could find online - http://www.tannerhelland.com/4435/convert-temperature-rgb-algorithm-code/

Hey great! Thank you!

And if anyone wants to know more about the subject, I believe this is where Mark got the pre made rgb values from. http://planetpixelemporium.com/tutorialpages/light.html

No problem. I tested it out with a potentiometer and the results look good. Maybe one day a faster version will make its way into FastLed :slight_smile:

I have a half-done fast version-- but it’s only half done. Maybe this will be the inspiration to finish it!
In the meantime, everyone can use yours – which totally works!

Sounds good. If I can find a RTC, the idea of f.lux for a room sounds cool.