Erythrolitmin

Erythrolitmin (also called erythrolein) is the active ingredient extracted from the Litmus lichen, used in chemistry as a pH indicator. The erythrolitmin molecule is related to the orceins, and consists essentially of several phenoxazone and orcinol residues. Its precise structure can be found here.

Interaction with acids
The intense colour 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.