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

◆ fill_gradient() [1/4]

template<typename T>
void fl::fill_gradient ( T * targetArray,
u16 numLeds,
const CHSV & c1,
const CHSV & c2,
const CHSV & c3,
const CHSV & c4,
TGradientDirectionCode directionCode = SHORTEST_HUES )

Fill a range of LEDs with a smooth HSV gradient between four HSV colors.

See also
fill_gradient()
Parameters
targetArraya pointer to the color array to fill
numLedsthe number of LEDs to fill
c1the starting color in the gradient
c2the first middle color for the gradient
c3the second middle color for the gradient
c4the end color for the gradient
directionCodethe direction to travel around the color wheel

Definition at line 251 of file fill.h.

253 {
254 u16 onethird = (numLeds / 3);
255 u16 twothirds = ((numLeds * 2) / 3);
256 u16 last = numLeds - 1;
257 fill_gradient(targetArray, 0, c1, onethird, c2, directionCode);
258 fill_gradient(targetArray, onethird, c2, twothirds, c3, directionCode);
259 fill_gradient(targetArray, twothirds, c3, last, c4, directionCode);
260}
void fill_gradient(T *targetArray, u16 startpos, CHSV startcolor, u16 endpos, CHSV endcolor, TGradientDirectionCode directionCode=SHORTEST_HUES) FL_NOEXCEPT
Fill a range of LEDs with a smooth HSV gradient between two HSV colors.
Definition fill.h:105

References fill_gradient(), FL_NOEXCEPT, and SHORTEST_HUES.

+ Here is the call graph for this function: