How do acid base indicators work?
An acid-base indicator is a weak base or acid that will be protonated or deprotonated at a certain pH. Being very useful for titrations as well as just general pH control.
The theory is that every indicator can be described as
If we take minus log of both sides:
We say that we'll have the color change when we have 10 times more of a certain species than the other, so we'll have the acid color when we have 10 times more acid than base
Solving for pH we have
We can similarly work this out to get
For the basic color. This of course, excludes other qualitatives means of testing like precipitation of a certain species, complexation being allowed due to pH, etc. but those are much less common.
Now, you might be wondering why the acid form and the basic form have different colors? The answer to this is because of the electronic transitions.
Indicators as a rule are always big organic compounds full of aromatic rings and so forth, this is because these allow easier transition of electrons through ressonance, but when you take off a proton, the oxygen associated with that proton starts interfering with the ressonance. That's why the acid form is almost always either incolor or a more energetic color.
The video below shows an experiment using an indicator derived from boiling red cabbage. A pigment from the cabbage called anthocyanin is what causes all of the different colors you see.
Other common indicators include:
Hope this helps!