Over the course of generations, humans living at the Sun-saturated latitudes in Africa adapted to have a higher melanin production threshold and more eumelanin, giving skin a darker tone.
It comes in two broad varieties — eumelanin, which is responsible for the black and brown colours, and pheomelanin, which lends the skin and hair yellow to reddish hues.
There's eumelanin, which gives rise to a range of brown skin tones, as well as black, brown, and blond hair, and pheomelanin, which causes the reddish browns of freckles and red hair.