Gram Positive
When the primary stain identifies the bacteria, the result is gram-positive, which is sometimes called "gram non-negative." The word "gram" is now a generic term for bacteria staining of all types. Crystal violet --- or methylene blue, which is sometimes used --- turn bacteria purple-brown when viewed through a microscope. If the result is gram-negative, the bacteria does not retain the color of the primary stain and turns red.
Cell Wall
The primary stain works because the bacteria cell wall retains the crystal violet dye. Once that occurs, scientists add iodine, which "fixes" the dye. That means the cell wall retains the color a longer time, allowing for further observation.
Other Methods
Staining methods other than Gram use different primary stains to identify other parts of the bacteria. Those parts include flagella, capsules, granules and spores. The primary stain in each of these methods functions as an identification agent. The process used by each method is similar to the one invented by Hans Christian Gram.
Identification
Scientists and microbiologists who utilize the Gram staining method today benefit from prior work. Certain bacteria test gram-positive and others test gram-negative. With this knowledge, bacteria can be easily identified using the primary stain. For example, if you are testing for Streptococcus, you know it tests gram-positive and appears in a chain. When the tests results appear, it becomes clear whether or not the sample taken has Streptococcus. The primary stain functions to produce the diagnosis.