Fill Rainbow Question. I'm curious what the deltahue parameter of the Fill Rainbow function

Fill Rainbow Question.

I’m curious what the deltahue parameter of the Fill Rainbow function does.

I tried to find more info in the code but couldn’t see anything.

Cheers.

Phil

In this example:
fill_rainbow( leds, NUM_LEDS, 0, 5);
“0” is the start hue, and “5” is the delta hue between LEDs. So led[0] would be hue 0, and the next led would be hue 5, then hue 10, etc.

This would do a full transition over the length of your strip.
fill_rainbow( leds, NUM_LEDS, 0, 255/NUM_LEDS );

This would display half the rainbow over the length of your strip.
fill_rainbow( leds, NUM_LEDS, 0, 255/NUM_LEDS/2 );

This would display two rainbows over the length of your strip.
fill_rainbow( leds, NUM_LEDS, 0, 255/NUM_LEDS*2 );

A bit more info here:
https://plus.google.com/100542328320334100166/posts/Y5BdWFEvfo1

Excellent, very helpful. Thanks

Hey @marmil here’s a followup question:

The fill_rainbow command fills at full saturation and full brightness. Is there a way to control the brightness? The rest of my code is set for brightness(30) and when this function is called, its an eye opener!

@Tim_Lukasik you’ll need to run fadeToBlackBy (or another fade function) to darken it down before calling FastLED.show.

You might look into finding/making yourself a custom color palette with a desaturated rainbow palette tuned to your needs.

You could also experiment with adding a bit of white (“tinting”) to the pixels before fading them down to desaturate. (I think that might work… Traveling so can’t actually test at the moment.)
Revisit this page for more info.

Sounds good I’ll give that a try and let you know, thank you!

@Tim_Lukasik