It gets its natural color from a type of pigment called melanin. The formation of melanin begins before birth. The natural color of our hair depends upon the distribution, type and amount of melanin in the middle layer of the hair shaft or cortex.