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

◆ lerp16by8()

LIB8STATIC fl::u16 lerp16by8 ( fl::u16 a,
fl::u16 b,
fract8 frac )

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

Definition at line 398 of file lib8tion.h.

399 {
400 fl::u16 result;
401 if( b > a) {
402 fl::u16 delta = b - a;
403 fl::u16 scaled = scale16by8( delta, frac);
404 result = a + scaled;
405 } else {
406 fl::u16 delta = a - b;
407 fl::u16 scaled = scale16by8( delta, frac);
408 result = a - scaled;
409 }
410 return result;
411}
expected< T, E > result
Alias for expected (Rust-style naming)
Definition result.h:31

References FL_NO_EXCEPT, and LIB8STATIC.