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

◆ scale8_to_16_accurate()

static u16 fl::scale8_to_16_accurate ( u8 x)
inlinestatic

Definition at line 11 of file hsv16.cpp.

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

References x.

Referenced by RGBtoHSV16().

+ Here is the caller graph for this function: