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

◆ lerp8()

CRGB CRGB::lerp8 ( const CRGB & other,
fract8 amountOf2 ) const

Return a new CRGB object after performing a linear interpolation between this object and the passed in object.

Note
Equivalent to the free function blend(*this, other, amountOf2). There is deliberately no CHSV::lerp8 — interpolating hue requires choosing which way around the color wheel to travel, so the CHSV equivalent is blend(const CHSV&, const CHSV&, fract8, TGradientDirectionCode), which takes that direction as a parameter.
See also
blend(const CRGB&, const CRGB&, fract8)
blend(const CHSV&, const CHSV&, fract8, TGradientDirectionCode)

Definition at line 100 of file crgb.cpp.hpp.

100 {
101 CRGB ret;
102
103 ret.r = lerp8by8(r, other.r, amountOf2);
104 ret.g = lerp8by8(g, other.g, amountOf2);
105 ret.b = lerp8by8(b, other.b, amountOf2);
106
107 return ret;
108}
LIB8STATIC fl::u8 lerp8by8(fl::u8 a, fl::u8 b, fract8 frac) FL_NO_EXCEPT
Linear interpolation between two unsigned 8-bit values, with 8-bit fraction.
Definition lib8tion.h:364
InputGamut g
Definition rgbw.h:125
FASTLED_FORCE_INLINE CRGB() FL_NO_EXCEPT
Default constructor.
Definition crgb.h:111

References CRGB(), fl::FL_NO_EXCEPT, fl::g, and lerp8by8().

+ Here is the call graph for this function: