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

◆ map16_to_8()

LIB8STATIC_ALWAYS_INLINE uint8_t map16_to_8 ( uint16_t x)

Definition at line 35 of file intmap.h.

35 {
36 // Tested to be nearly identical to double precision floating point
37 // doing this operation.
38 if (x == 0) {
39 return 0;
40 }
41 if (x >= 0xff00) {
42 return 0xff;
43 }
44 return uint8_t((x + 128) >> 8);
45}
int x
Definition simple.h:92

References LIB8STATIC_ALWAYS_INLINE, and x.

Referenced by fl::easeInOutSine8(), fl::easeOutSine8(), and fl::HSV16toRGB().

+ Here is the caller graph for this function: