LEDs produce different colors by using various materials which produce photons at different wavelengths. Those individual wavelengths appear as light of different colors.
LEDs use materials that can handle the necessary levels of electricity, heat, and humidity. High-brightness red and amber LEDs use the aluminum indium gallium phosphide (AlInGaP) material system. Blue, green and cyan LEDs use the indium gallium nitride (InGaN) system.
Together, AlInGaP and InGaN cover almost the entire light spectrum, with a gap at green-yellow and yellow. One method of achieving a larger spectrum of colors is to mix different colors of LEDs in the same device.
Combining red, green, and blue LEDs in a single LED device, such as a lighting fixture or multi-chip LED, and controlling their relative intensities can produce millions of colors. Additionally combining red, green, and blue in equal amounts produces white light.