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

◆ getLuma()

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

Get the "luma" of a CRGB object.

In other words, roughly how much light the CRGB pixel is putting out (from 0 to 255).

Definition at line 141 of file crgb.hpp.

141 {
142 //Y' = 0.2126 R' + 0.7152 G' + 0.0722 B'
143 // 54 183 18 (!)
144
145 fl::u8 luma = scale8_LEAVING_R1_DIRTY( r, 54) + \
146 scale8_LEAVING_R1_DIRTY( g, 183) + \
147 scale8_LEAVING_R1_DIRTY( b, 18);
148 cleanup_R1();
149 return luma;
150}
unsigned char u8
Definition s16x16x4.h:132

References FASTLED_FORCE_INLINE, and FL_NOEXCEPT.