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

◆ fill_rainbow() [1/2]

void fl::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 41 of file fill.cpp.

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}
Representation of an HSV pixel (hue, saturation, value (aka brightness)).
Definition chsv.h:16