FastLED 3.10.8
Loading...
Searching...
No Matches

◆ lerp8by8()

LIB8STATIC fl::u8 lerp8by8 ( fl::u8 a,
fl::u8 b,
fract8 frac )

Linear interpolation between two unsigned 8-bit values, with 8-bit fraction.

Definition at line 364 of file lib8tion.h.

365 {
367 if( b > a) {
368 fl::u8 delta = b - a;
369 fl::u8 scaled = scale8( delta, frac);
370 result = a + scaled;
371 } else {
372 fl::u8 delta = a - b;
373 fl::u8 scaled = scale8( delta, frac);
374 result = a - scaled;
375 }
376 return result;
377}
unsigned char u8
Definition stdint.h:131
expected< T, E > result
Alias for expected (Rust-style naming)
Definition result.h:31

References FL_NO_EXCEPT, and LIB8STATIC.

Referenced by fl::CRGB::lerp8(), and loop().

+ Here is the caller graph for this function: