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

◆ to_uint8()

static u8 fl::to_uint8 ( float f)
static

Definition at line 9 of file splat.cpp.hpp.

9 {
10 // convert to [0..255] range
11 u8 i = static_cast<u8>(f * 255.0f + .5f);
12 return fl::min(i, 255);
13}
unsigned char u8
Definition stdint.h:131
FL_DISABLE_WARNING_PUSH U constexpr common_type_t< T, U > min(T a, U b) FL_NO_EXCEPT
Definition math.h:71

References FL_NO_EXCEPT, and min().

Referenced by splat().

+ Here is the call graph for this function:
+ Here is the caller graph for this function: