The hair is composed of two main parts, an exposed cuticle above the scalp's surface made of mostly protein and a root beneath the scalp's surface in the follicle, where hair begins developing it's characteristics, such as color.
Melanin is the body's natural chemical which determines the color of skin, hair and eyes. The more melanin there is, the more color, and the darker one's features, according to Brownskin.net, a dermatological website. Melanin helps protect skin from ultra-violet radiation, which is why people produce more color after sun exposure.
The follicle contains cells called melanocytes, which produce pigments. These pigments are the melanin which determines hair's color--either black, brown, red or blond.
Melanocytes are scattered throughout the scalp's skin between follicles and within the hair follicle in small clusters, according to Keratin.com, a hair information website. The cells are the same in skin or follicle, and the skin can tap into the follicle's supply if it becomes deficient in melanocytes.
Melanocytes are located toward the bottom of the follicle, in the bulb, where they can work alongside the cells that produce hair fibers. As they produce melanin, it's used by the growing hair fiber, according to Keratin.com.
Melanin accumulates within melanosomes in the melanocytes. The black hair has follicles which contain large oval melanosomes densely filled with melanin, while blond and redheads have smaller, less dense, spherical melanosomes, causing their hair to be much lighter.