The evolution of dark skin is tied with the question of loss of body hair.
By 1.2 million years ago, all people having descendants today had exactly the receptor protein of today's Africans; their skin was dark, and the intense sun killed off the progeny with any lighter skin that resulted from mutational variation in the receptor protein. This is significantly earlier than the speciation of Homo sapiens from Homo erectus some 250,000 years ago.
Dark skin helps protect against skin cancer that develops as a result of ultraviolet light radiation, causing mutations in the skin. Furthermore, dark skin prevents an essential B vitamin, folate, from being destroyed.
Therefore, in the absence of modern medicine and diet, a person with dark skin in the tropics would live longer, be more healthy and more likely to reproduce than a person with light skin. White Australians have some of the highest rates of skin cancer as evidence of this expectation.
Conversely, as dark skin prevents sunlight from penetrating the skin it hinders the production of vitamin D3. Hence when humans migrated to less sun-intensive regions in the north, low vitamin D3 levels became a problem and lighter skin colors started appearing.
The people of Europe, who have low levels of melanin, naturally have an almost colorless skin pigmentation, especially when untanned. This low level of pigmentation allows the blood vessels to become visible and gives the characteristic pale pink color of white people.
The difference in skin color between black and whites is however a minor genetic difference accounting for just one letter in 3.1 billion letters of DNA.
Some scholars argue that based on cave paintings, Europeans may have been dark-skinned as late as 13,000 years ago. The painters depicted themselves as having darker complexions than the animals they hunted.
This hypothesis finds support from genetics with the discovery of the SLC24A5 gene in 2005.
The mutation resulting in light skin is currently estimated to have originated among Europeans some 6,000 to 12,000 years ago.