FastLED 3.9.15
Loading...
Searching...
No Matches

◆ getAverageLight()

FASTLED_FORCE_INLINE fl::u8 CRGB::getAverageLight ( ) const

Get the average of the R, G, and B values.

Examples
TwinkleFox.ino.

Definition at line 152 of file crgb.hpp.

152 {
153#if FASTLED_SCALE8_FIXED == 1
154 const fl::u8 eightyfive = 85;
155#else
156 const fl::u8 eightyfive = 86;
157#endif
158 fl::u8 avg = scale8_LEAVING_R1_DIRTY( r, eightyfive) + \
159 scale8_LEAVING_R1_DIRTY( g, eightyfive) + \
160 scale8_LEAVING_R1_DIRTY( b, eightyfive);
161 cleanup_R1();
162 return avg;
163}
unsigned char u8
Definition s16x16x4.h:132

References FASTLED_FORCE_INLINE, and FL_NOEXCEPT.

Referenced by fl::TwinkleFox::drawTwinkleFox(), and drawTwinkles().

+ Here is the caller graph for this function: