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

fastled-support
gplus
(Phil Spitler) #1

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

(Marc Miller) #2

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:

(Phil Spitler) #3

Excellent, very helpful. Thanks

(Tim Lukasik) #4

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!

(Marc Miller) #5

@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.

(Marc Miller) #6

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.

(Tim Lukasik) #7

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

(Marc Miller) #8

@Tim_Lukasik