Question: how do rgb leds work?
Answer: In summary: an RGB LED is a combination of three LEDs in just one package: red, green and blue; ... you generate different colors by adjusting the brightness of each of the three LEDs of the RGB LED; to adjust the brightness of each LED, you use a PWM signal.