To identify bacteria, researchers treat them with a violet Gram stain. Gram-positive bacteria retain the dye, and so appear purple or blue under a microscope. Gram-negative bacteria appear red or pink.