Skin color is mainly due to melanin. The amount of melanin is determined primarily by hereditary factors and by the result of exposure to ultraviolet radiation (tanning).