FastLED 3.9.15
Loading...
Searching...
No Matches

◆ fill_rainbow() [1/2]

void fill_rainbow ( struct CHSV * targetArray,
int numToFill,
uint8_t initialhue,
uint8_t deltahue = 5 )

Fill a range of LEDs with a rainbow of colors.

The colors making up the rainbow are at full saturation and full value (brightness).

Parameters
targetArraya pointer to the LED array to fill
numToFillthe number of LEDs to fill in the array
initialhuethe starting hue for the rainbow
deltahuehow many hue values to advance for each LED

Definition at line 89 of file colorutils.cpp.

92{
93 CHSV hsv;
94 hsv.hue = initialhue;
95 hsv.val = 255;
96 hsv.sat = 240;
97 for( int i = 0; i < numToFill; ++i) {
98 targetArray[i] = hsv;
99 hsv.hue += deltahue;
100 }
101}
Representation of an HSV pixel (hue, saturation, value (aka brightness)).
Definition chsv.h:16