Light can travel at various speeds in different media, producing a frequency at which the wave travels. The energy contained in a wave of light is related to its frequency. Where E represents energy, h represents Planck's Constant energy, and c is the speed of light. The amount of energy, E, contained in a single photon is directly proportional to its frequency. Short wavelengths have high energies while long wavelengths have lower energies.
Different colors result from different wavelengths.
Human percieve light as having distinct colors. Most people can see electromagnetic radiation with wavelengths from 400 to 700 nm. At 400 nm they are at the blue end of the visible spectrum, whereas 700 nm is at the red end of the spectrum. A photon of red light has less energy than a photon at blue light. The energy contained in a photon is directly proportional to the wavelength.