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

◆ lerp16()

FASTLED_FORCE_INLINE CRGB CRGB::lerp16 ( const CRGB & other,
fract16 frac ) 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 167 of file crgb.hpp.

168{
169 CRGB ret;
170
171 ret.r = lerp16by16(r<<8,other.r<<8,frac)>>8;
172 ret.g = lerp16by16(g<<8,other.g<<8,frac)>>8;
173 ret.b = lerp16by16(b<<8,other.b<<8,frac)>>8;
174
175 return ret;
176}
LIB8STATIC fl::u16 lerp16by16(fl::u16 a, fl::u16 b, fract16 frac) FL_NO_EXCEPT
Linear interpolation between two unsigned 16-bit values, with 16-bit fraction.
Definition lib8tion.h:381
InputGamut g
Definition rgbw.h:125
FASTLED_FORCE_INLINE CRGB() FL_NO_EXCEPT
Default constructor.
Definition crgb.h:111

References CRGB(), FASTLED_FORCE_INLINE, fl::FL_NO_EXCEPT, fl::g, and lerp16by16().

+ Here is the call graph for this function: