Melanin is a class of proteins found in many plants and animals that usually acts as a pigment. Humans produce two forms of melanin, one that is brown-black in color and one that is red-brown in color, that account for skin color, eye color, hair color and other pigmentation. These are produced in varying quantities by the vast majority of people, but are controlled by several genes which account for the wide variety of coloration.
The skin produces melanin in response to sunlight, causing tanning of people with lighter skin tones. Melanin can convert a great deal of ultraviolet radiation to heat without suffering damage, making it an important part of protection of the skin from burning and even skin cancer. However, large amounts of melanin also discourage the production of Vitamin D.