FastLED 3.9.15
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 397 of file lib8tion.h.

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

References LIB8STATIC.