Final answer:
The primary function of melanin is to protect against the sun's UV rays.
Step-by-step explanation:
The primary function of melanin is to provide protection against the sun's UV rays. Melanin is a pigment produced by melanocytes in the skin, hair, and eyes. It absorbs UV radiation from the sun and helps prevent damage to the DNA of skin cells.
Learn more about The role of melanin in protecting against UV rays