RGB Color Mixing for LED Pixels
Understanding how LED pixels create color is fundamental to designing great animations and lighting effects. This guide covers additive RGB mixing, the HSV color space preferred for animation, gamma correction, and color rendering quality.
Additive RGB Color Mixing
LED pixels use additive color mixing — each pixel contains separate Red, Green, and Blue LEDs that combine their light output to create any perceived color. When all three channels are off, you see black (no light). When all three are at full brightness, you see white. The primary combinations are: Red + Green = Yellow, Red + Blue = Magenta, Green + Blue = Cyan. With 8-bit control per channel (0-255), pixels can display 256³ = 16,777,216 distinct colors.
HSV Color Space
While RGB defines colors by mixing primaries, HSV (Hue, Saturation, Value) describes color the way humans think about it: What color? (Hue: 0-255 mapped to the rainbow), How vivid? (Saturation: 0=gray, 255=pure color), How bright? (Value: 0=off, 255=full). FastLED's CHSV type makes animation intuitive — incrementing Hue by 1 each frame creates a smooth rainbow cycle without any math.
Gamma Correction
Human vision perceives brightness logarithmically, not linearly. A pixel at 50% PWM duty cycle (value 128) looks much brighter than "half" brightness — it appears about 73% as bright. Gamma correction applies a power curve (typically γ = 2.2 or 2.8) to map linear PWM values to perceptually uniform brightness steps. Without gamma correction, fades look uneven and washed out. FastLED's dim8_video() applies approximate gamma correction per frame.
Color Temperature & CRI
RGB pixel LEDs produce "white" by mixing all three channels at full power. This synthetic white has a color temperature of roughly 6500K (cool daylight) and a CRI (Color Rendering Index) of only 20-40 — objects lit by it look unnatural. For applications requiring quality white light, SK6812 RGBW pixels add a dedicated warm white LED (2700-4000K) with CRI 80+, producing natural-looking illumination alongside colorful effects.