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

◆ fadeUsingColor()

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

Definition at line 175 of file colorutils.cpp.

175 {
176 uint8_t fr, fg, fb;
177 fr = colormask.r;
178 fg = colormask.g;
179 fb = colormask.b;
180
181 for (uint16_t i = 0; i < numLeds; ++i) {
182 leds[i].r = scale8_LEAVING_R1_DIRTY(leds[i].r, fr);
183 leds[i].g = scale8_LEAVING_R1_DIRTY(leds[i].g, fg);
184 leds[i].b = scale8(leds[i].b, fb);
185 }
186}
CRGB leds[NUM_LEDS]
Definition Apa102.ino:11
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:176
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:40