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

◆ fill_rainbow() [1/3]

void fl::fill_rainbow ( CHSV * targetArray,
int numToFill,
fl::u8 initialhue,
fl::u8 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 41 of file fill.cpp.hpp.

42 {
43 CHSV hsv;
44 hsv.hue = initialhue;
45 hsv.val = 255;
46 hsv.sat = 240;
47 for (int i = 0; i < numToFill; ++i) {
48 targetArray[i] = hsv;
49 hsv.hue += deltahue;
50 }
51}
fl::hsv8 CHSV
Definition chsv.h:11