Hematoxylin is a basic dye that has a strong affinity for acidic components of the cell, such as DNA and RNA. When applied to tissue sections, hematoxylin binds to the nucleic acids in the cell nuclei, staining them a deep blue or purple color. This makes the nuclei easily distinguishable from other cell components.