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

◆ fill_palette()

template<typename PALETTE>
void fill_palette ( CRGB * L,
uint16_t N,
uint8_t startIndex,
uint8_t incIndex,
const PALETTE & pal,
uint8_t brightness = 255,
TBlendType blendType = LINEARBLEND )

Fill a range of LEDs with a sequence of entries from a palette.

Template Parameters
PALETTEthe type of the palette used (auto-deduced)
Parameters
Lpointer to the LED array to fill
Nnumber of LEDs to fill in the array
startIndexthe starting color index in the palette
incIndexhow much to increment the palette color index per LED
palthe color palette to pull colors from
brightnessbrightness value used to scale the resulting color
blendTypewhether to take the palette entries directly (NOBLEND) or blend linearly between palette entries (LINEARBLEND)

Definition at line 2094 of file colorutils.h.

2096{
2097 uint8_t colorIndex = startIndex;
2098 for( uint16_t i = 0; i < N; ++i) {
2099 L[i] = ColorFromPalette( pal, colorIndex, brightness, blendType);
2100 colorIndex += incIndex;
2101 }
2102}
UISlider brightness("Brightness", 255, 0, 255, 1)
CRGB ColorFromPalette(const CRGBPalette16 &pal, uint8_t index, uint8_t brightness=255, TBlendType blendType=LINEARBLEND)
Get a color from a palette.

References brightness, ColorFromPalette(), and LINEARBLEND.

+ Here is the call graph for this function: