Erythrolitmin

Erythrolitmin (also called erythrolein) is the active ingredient extracted from the Litmus lichen, used in chemistry as a pH indicator. Erythrolitmin is related to the orceins, and consists essentially of several phenoxazone and orcinol residues.

Interaction with acids
The intense coloring of the molecule is generated by the absorption of specific wavelengths of light by the pi bonds. These bonds are ordinarily excited by light in the orange region of the spectrum, causing the molecule to appear blue. When the molecule interacts with protons from an acid the bonds become harder to excite and thus absorb green light which has a shorter wavelength. This is what causes the molecule to appear red in the presence of an acid.