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

◆ rgb_2_rgbw_exact()

void fl::rgb_2_rgbw_exact ( u16 w_color_temperature,
u8 r,
u8 g,
u8 b,
u8 r_scale,
u8 g_scale,
u8 b_scale,
u8 * out_r,
u8 * out_g,
u8 * out_b,
u8 * 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:14

Definition at line 80 of file rgbw.cpp.hpp.

83 {
84 (void)w_color_temperature;
85 r = scale8(r, r_scale);
86 g = scale8(g, g_scale);
87 b = scale8(b, b_scale);
88 u8 min_component = min3(r, g, b);
89 *out_r = r - min_component;
90 *out_g = g - min_component;
91 *out_b = b - min_component;
92 *out_w = min_component;
93}
unsigned char u8
Definition stdint.h:131

Referenced by rgb_2_rgbw(), rgb_2_rgbw_colorimetric(), rgb_2_rgbw_colorimetric_boosted(), and rgb_2_rgbw_user_function().

+ Here is the caller graph for this function: