The primary stain is used in Gram staining to detect Gram-positive bacteria. The primary stain is a crystal violet color. When a bacteria is Gram-negative, it loses the primary stain and takes on the secondary stain of safranin.
Differences in thickness of the peptidoglycan layer of the cell membrane of bacteria makes it possible to distinguish Gram-positive from Gram-negative bacteria. Bacteria that are Gram-positive have a thicker peptidoglycan layer and are able to retain the primary color of crystal violet.
Gram staining is a three-step process that involves primary staining, decolorizing to dehydrate the peptidoglycan layer and secondary staining to determine the type of bacteria.