This isn't quite on topic, but...

This isn’t quite on topic, but… Is there a way to change the colour “temperature” of HSV or RGB values? I have a simple LED strip which I am driving using PWM, but its full white is “cool white” and I would rather “warm white” if that is possible? I’m not using the library for this but the same technique might be applicable to led strip pixels. Thanks! :slight_smile:

Funny you should mention it.

We have some things in the works for the future for the library for color correction, but in the meantime I’ll post some code later today.

The short version is to scale the blue light level down by a percentage, and the green light level down by a (much) lower percentage.

E.g.

OutputRed = InputRed;
OutputBlue = InputBlue * 0.75;
OutputGreen = InputGreen * 0.90;

Adjust the constants to taste.

And if you’re doing this in 8-bit AVR Arduino land and if performance or code size matters, using the FastLED library’s “scale8” function is much smaller and faster:

OutRed = InRed;
OutBlue = scale8( InBlue, 255 * 0.75);
OutGreen = scale8( InGreen, 255 * 0.90);

{leds[i].r = 255; leds[i].g = 147; leds[i].b = 41;} //-CANDLE - 1900
{leds[i].r = 255; leds[i].g = 197; leds[i].b = 143;} //-40W TUNG - 2600
{leds[i].r = 255; leds[i].g = 214; leds[i].b = 170;} //-100W TUNG - 2850
{leds[i].r = 255; leds[i].g = 241; leds[i].b = 224;} //-HALOGEN - 3200
leds[i].r = 255; leds[i].g = 250; leds[i].b = 244;} //-CARBON ARC - 5200
{leds[i].r = 255; leds[i].g = 255; leds[i].b = 251;} //-HIGH NOON SUN - 5400
{leds[i].r = 255; leds[i].g = 255; leds[i].b = 255;} //-DIRECT SUN - 6000
{leds[i].r = 201; leds[i].g = 226; leds[i].b = 255;} //-OVERCAST SKY - 7000
{leds[i].r = 64; leds[i].g = 156; leds[i].b = 255;}//-CLEAR BLUE SKY - 20000

Stolen from funkboxing :slight_smile:

Thanks!
I’ll also update my copy of the funkboxing demo! :wink:

I am going to implement this, possibly with FastSPI_LED since it now supports “Gemma” and “Trinket”.

“Color correction” of some sort (TBD) is coming eventually in the FastLED library itself, but that may not be for a while, and in the meantime I’m very curious to see what people are doing and interested in!

Thanks for sharing the links and code; keep it up!