The main function of melanin is to provide pigmentation mainly to the skin, hair and iris of the eye. In addition melanin is important in protecting the skin from ultra violet rays of the sun which can be damaging. This is why albinos are highly susceptible to skin problems such as sun burns caused by UV rays.elanin is produced in the skin in cells known as melanocytes and through a process called melanogenesis. There exist different subtypes of melanin which are found in different people and different parts of the body.