How does sunlight affect the epidermis?
Epidermis is formed of stratified epithelium . Below stratified epithelium are melanocytes.
The melanocytes below epidermal cells have melanin granules. In bright light the melanin granules spread. While in low intensity light melanin granules shrink. When melanin granules spread skin looks dark. When melanin granules shrink skin looks pale.
This is the reason people living near equator are with dark skin. The article and people in cold climate away from equator are with pale skin.
Dark skin protects against ultraviolet rays and skin cancer.