Many hairs have deeper color at the tip than near the base, and some are black at the tip and have one or more bands of brown, red, yellow or cream color as you move toward the base of the hair. This kind of banded hair color is called agouti, after a South American rodent with banded hair. It occurs to varying degrees in at least some hairs of many dogs, cats, horses, and the majority of wild animals of brownish or greyish color. We don't fully understand what happens in nature to produce bands of different color in the same hair, but we have a pretty good idea. The key lies in specialized cells called melanocytes, which are derived from the same embryonic structure as our backbones and nervous systems.
Melanocytes act as factories for the production of granules of the pigment, melanin.
Their action is stimulated by ultraviolet radiation, leading to tanning in human beings. In furred animals, this leads to dark skin on noses and around eyes, and sometimes to dark areas where hair has been shaved. The number of melanocytes doesn't seem to vary much by race in human beings, but their level of activity does. The melanocytes that migrate into the hair bulbs inject their pigment directly into the developing hair shaft. Their activity tends to be highest as the point of the new hair is first being formed, which is probably why many reddish animal hairs are darker at the tip than at the base.