LEDs and laser diodes usually emit photons with energy close to and slightly larger than the band gap of the semiconductor material from which they are made. Therefore, as the band gap energy increases, the LED or laser color changes from infrared to red, through the rainbow to violet, then to UV.