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

◆ fadeUsingColor()

void fl::fadeUsingColor ( CRGB * leds,
fl::u16 numLeds,
const CRGB & colormask )

Definition at line 176 of file colorutils.cpp.

176 {
177 fl::u8 fr, fg, fb;
178 fr = colormask.r;
179 fg = colormask.g;
180 fb = colormask.b;
181
182 for (fl::u16 i = 0; i < numLeds; ++i) {
183 leds[i].r = scale8_LEAVING_R1_DIRTY(leds[i].r, fr);
184 leds[i].g = scale8_LEAVING_R1_DIRTY(leds[i].g, fg);
185 leds[i].b = scale8(leds[i].b, fb);
186 }
187}
CRGB leds[NUM_LEDS]
LIB8STATIC_ALWAYS_INLINE uint8_t scale8_LEAVING_R1_DIRTY(uint8_t i, fract8 scale)
This version of scale8() does not clean up the R1 register on AVR.
Definition scale8.h:180
LIB8STATIC_ALWAYS_INLINE uint8_t scale8(uint8_t i, fract8 scale)
Scale one byte by a second one, which is treated as the numerator of a fraction whose denominator is ...
Definition scale8.h:44
unsigned char u8
Definition int.h:17

References leds, scale8(), and scale8_LEAVING_R1_DIRTY().

+ Here is the call graph for this function: