Hi everybody, I am currently learning how to work with FastLED to add some

Hi everybody,

I am currently learning how to work with FastLED to add some mood lighting to my house. I am using a nodeMCU that gets it’s commands from an MQTT topic from Home Assistant, that part works like a charm, just like setting colors etc but the colors are now chaning instantly. I would like to achieve a crossfade when I change colors, I can probably get it done with some loops left and right but I also noticed the blend functionality.

I am no programmer but can find my way around programming pretty well but could not find any documentation (that I can understand) on how to use the blend functions. There are a lot of basic tutorials on how to get started but no detailed tutorials on more advanced functionality, at least none that I could find.

Can somebody point me to a decent tutorial or examples that I can use to figure out the more advanced functions (especially the blend function)?

BR,
Bram!

You can use RGB or HSV with blend. The two colors to blend are followed by a 0-255 value which determines how much of each color is used (ie. 0 = all colorA, 128 = 50% of each, and 255 = colorB completely overlays colorA).

If using HSV you can also specify how it goes around the color wheel toward the second color by using:
BACKWARD_HUES: hue always goes counter-clockwise
SHORTEST_HUES: hue goes whichever way is shortest
LONGEST_HUES: hue goes whichever way is longest
(The default is SHORTEST_HUES.)

Here are two examples that use blend:

Thanks Marc, i’ll give it a go soon.