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

◆ lerp16by16()

LIB8STATIC fl::u16 lerp16by16 ( fl::u16 a,
fl::u16 b,
fract16 frac )

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

Definition at line 381 of file lib8tion.h.

382 {
383 fl::u16 result;
384 if( b > a ) {
385 fl::u16 delta = b - a;
386 fl::u16 scaled = scale16(delta, frac);
387 result = a + scaled;
388 } else {
389 fl::u16 delta = a - b;
390 fl::u16 scaled = scale16( delta, frac);
391 result = a - scaled;
392 }
393 return result;
394}
expected< T, E > result
Alias for expected (Rust-style naming)
Definition result.h:31

References FL_NO_EXCEPT, and LIB8STATIC.

Referenced by fl::CRGB::lerp16().

+ Here is the caller graph for this function: