I have been using FastLED for its many awesome math functions (hsv conversion, blending, fading, etc) even though I have a cheap analog 5050 rgb strip. As the analog example does not create a FastLED instance I was wondering if there was still a way to do temperature/color correction to help with the strips natural blue tint.
I put something like this in for a one off project, it’s not documented yet because I’m going to change how it is done, but in the meantime if you have the latest master branch you can do:
uint8_t brightness = 128;
CRGB colorCorrection = TypicalSMD5050;
CRGB colorTemperature = UncorrectedTemperature;
….
// you only need to call computeAdjustment when one of brightness, colorCorrection, and colorTemperature change, just save the value that comes back from it
CRGB scalingAdjust = CLEDController::computeAdjustment(brightness, colorCorrection, colorTemperature);
…
CRGB correctedRGB = leds[i].scale8(scalingAdjust);
…
Wow. Thanks for the extremely quick reply. It’s pretty late here so I will probably head to bed soon and play around with it some tomorrow. Implementing the scaling shouldn’t be difficult since everything ends up calling a setRGB function to do the pwm out, so I could add it in there.
Just wanted to let you know that I got the correction and temperature working well. I had to make a temporary CRGB object to scale as my setRGB function took a constant parameter (if I remove the const then CHSV and others do not get automatically converted).
Ah, I can fix that later tonight.