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

◆ rgb_2_rgbw_exact()

void rgb_2_rgbw_exact ( uint16_t w_color_temperature,
uint8_t r,
uint8_t g,
uint8_t b,
uint8_t r_scale,
uint8_t g_scale,
uint8_t b_scale,
uint8_t * out_r,
uint8_t * out_g,
uint8_t * out_b,
uint8_t * out_w )

Converts RGB to RGBW using a color transfer method from saturated color channels to white.

This is designed to produce the most accurate white point for a given color temperature and reduces power usage of the chip since a white led is much more efficient than three color channels of the same power mixing together. However the pixel will never achieve full brightness since the white channel is 3x more efficient than the color channels mixed together, so in this mode the max brightness of a given pixel is reduced.

RGB(255, 255, 255) -> RGBW(0, 0, 0, 85)
RGB(255, 0, 0) -> RGBW(255, 0, 0, 0)
@ RGB
Red, Green, Blue (0012)
Definition eorder.h:15

Definition at line 40 of file rgbw.cpp.

43 {
44 (void)w_color_temperature;
45 r = scale8(r, r_scale);
46 g = scale8(g, g_scale);
47 b = scale8(b, b_scale);
48 uint8_t min_component = min3(r, g, b);
49 *out_r = r - min_component;
50 *out_g = g - min_component;
51 *out_b = b - min_component;
52 *out_w = min_component;
53}
LIB8STATIC_ALWAYS_INLINE uint8_t scale8(uint8_t i, fract8 scale)
Scale one byte by a second one, which is treated as the numerator of a fraction whose denominator is ...
Definition scale8.h:34
uint8_t min3(uint8_t a, uint8_t b, uint8_t c)
Definition rgbw.cpp:15

References scale8().

Referenced by rgb_2_rgbw(), and set_rgb_2_rgbw_function().

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