Hematoxylin is extracted from the heartwood of the logwood tree, Haematoxylum campechianum, and it is not itself the dye. It must be oxidized to hematein, slowly in air or quickly with an oxidant such as sodium iodate. Hematein then needs a mordant, usually aluminum, to form a positively charged dye-metal complex that binds the phosphate groups of nucleic acids. That is why chromatin stains strongly.
Freshly applied, the color is reddish purple, and a brief alkaline rinse, the bluing step, turns it the familiar blue. Progressive formulations such as Mayer's are applied until the right depth is reached. Regressive ones such as Harris's are overstained, then partly removed with dilute acid.