The mechanism responsible for tanning is melanin. Melanin is a black or brown pigment produced by cells called melanocytes. Melanin gives skin its pigmentation and filters the photons of ultraviolet radiation.
Constitutive skin color is determined by the amount of melanin in the skin. This skin color is the color that has not been affected by UV radiation. The facultative skin color is the color that has been affected by UV radiation. Tanning changes the composition of melanin. Exposure increases the size and the amount of melanin from melanocytes, resulting in a darker skin color. This process is called tanning reaction.