The eight gene variants that Dr. Tishkoff and her colleagues discovered in Africans turned out to be present in many populations outside the continent. By comparing the DNA of these people, the researchers were able to estimate how long ago the genes appeared.

They turned out to be immensely old. A variant for light skin — found in both Europeans and the San hunter-gatherers of Botswana — arose roughly 900,000 years ago, for example.

Even before there were Homo sapiens, then, our distant forebears had a mix of genes for light and dark skin. Some populations may have been dark-skinned and others light-skinned; or maybe they were all the same color, produced by a blend of variants.

Neanderthals split off from our own ancestors an estimated 600,000 years ago, spreading across Europe and eastern Asia. While they became extinct about 40,000 years ago, some of their DNA has survived.

These hominins inherited the same combination of variants determining skin color, Dr. Tishkoff and her colleagues also discovered. It’s possible that some populations of Neanderthals, too, were light-skinned, and others dark-skinned.

Living humans come packaged in a wide range of hues — from pale and freckly in Ireland to dark brown in southern India, Australia and New Guinea. Researchers have argued that these varying colors evolved partly in response to sunlight.