The function that a mordant has is to form a complex with the primary stain so that it becomes trapped with the bacteria that have structural properties. In Gram stain, the gram of iodine is used to form a complex with crystal violet, which becomes trapped in gram-positive cells. For this reason, its color is purple.