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

◆ scale8_to_16_accurate()

static u16 fl::scale8_to_16_accurate ( u8 x)
inlinestatic

Definition at line 12 of file hsv16.cpp.hpp.

12 {
13 if (x == 0) return 0;
14 if (x == 255) return 65535;
15 // Use 32-bit arithmetic with rounding: (x * 65535 + 127) / 255
16 // This is equivalent to: (x * 65535 + 255/2) / 255
17 return (u16)(((u32)x * 65535 + 127) / 255);
18}

References FL_NO_EXCEPT, and x.

Referenced by RGBtoHSV16().

+ Here is the caller graph for this function: