Similar to bromocresol green, the structure of bromocresol purple changes with pH. Changing the level of acidity causes a shift in the equilibrium between two different structures that have different colors. In near-neutral or alkaline solution, the chemical has a sulfonate structure that gives the solution a purple color. As the pH decreases, it converts to a sultone (cyclic sulfonic ester) that colors the solution yellow.  In some microbiology tests, this change is used as an indicator of bacterial growth.