The retina of the eye contains two types of photoreceptors: rods and cones. The cones are found on the Fovea, the central part of the retina, while the rods are found in the periphery.
Cones are chromatic, which means cones are what allow us to perceive color. There are three types of cones: one type reacts to blue light, one to red, and one to green. Any color in the visible light spectrum can be replicated by mixing these three colors.
The three types of cones account for the Purkinje shift. This shift is a visual effect that is perhaps most notable in a thunderstorm. When a thunderstorm starts to set in, the colors that we perceive change dramatically, from normal, everyday vision to mostly blues and blacks (yes, this happens every night as well, but the effect is more gradual). The reason for the shift is the wavelength of light each cone reacts to. The red cones react to length anywhere from 531-760 nanometers. As the storm rolls in, this length of light is blocked out by the clouds first, and so we quickly lose our red vision. Green cones run at 496-530 nanometers, so the next thing to go is our perception of greens (notice that all of the trees are starting to look more grey). What we're left with is a range of 380-495: blues and blacks.
Rods are achromatic; they are not sensitive to the wavelength of light, but rather to light intensity, or amplitude. Rods are easily saturable, which means that they shut down in the presence of bright light. The brighter the light, the fewer rods are reacting to it. Less rods sending signals is translated by the brain as brighter color.