Melanin is the pigment that determines the color of skin, hair, and eyes. The ratio of melanin pigment makes a difference in these colors. Melanin protects skin and hair from UV damage. Although it is often seen negatively as a cause of sunburn and dark spots, melanin is produced to protect our bodies by darkening the skin and reducing UV damage.