Yes, white humans evolved to have lighter skin pigmentation as a result of living in areas with less sunlight. Skin color is determined by the amount of melanin in the skin, which is produced by cells called melanocytes. Melanin is responsible for protecting the skin from UV radiation from the sun, which can cause skin damage and increase the risk of skin cancer.
As early humans migrated out of Africa to other parts of the world, they were exposed to different levels of sunlight. In areas with high levels of sunlight, such as Africa, darker skin was an advantage because it provided more protection against UV radiation. However, in areas with lower levels of sunlight, such as Europe, lighter skin was an advantage because it allowed more UV radiation to penetrate the skin, which helped the body produce vitamin D, an essential nutrient for bone growth and development.
Over time, natural selection favored individuals with lighter skin in regions with less sunlight, and this trait became more common in the population. This process is known as "positive selection for a derived allele." As a result, light skin pigmentation became the norm in many populations living in northern latitudes, such as Europe, Asia, and North America.
It's worth noting that skin pigmentation is a complex trait that is influenced by multiple genes, and there is still much to learn about the genetic and evolutionary factors that contribute to variations in skin color.