Minerals such as lead acetate, lead sulfide; silver nitrate; salts of bismuth, copper, and cobalt (commonly called "gradual" colorants) are used to dye hair. Chemicals are absorbed into hair to change the color. Semi-permanent and permanent dyes need to have surfactant, Solvent, alkalizing, oxidant, dye.
Hair dye is difficult to remove because it changes the chemical bonds that determine the color. It makes the hair fibers dry and fragile.
Paraphenylenediamine produces brown shades when used with oxidizing agents. If you want other colors of hair you add other chemicals to the mixture, these are called compounds or coupling agents. Coupling agents aren’t colored themselves but they react with other molecules to make a range of different colors.