Red cabbage contains a pigment molecule called flavin (an anthocyanin). This water-soluble pigment is also found in apple skin, plums, poppies, cornflowers, and grapes.
Red cabbage juice contains a natural pH indicator that changes colors according to the a acidity of the solution. This is very easy to make and exhibits a wide range of colors.
You can make it a couple different ways, one by chopping up the red cabbage into strips adding 2 cups of hot water and then blending it and then pouring into a coffee filter. This is give you a dark purple indicator like I used.
Or you can chop up the red cabbage into strips and pour hot water with the strips (NO Blending). This will give you a dark blue color indicator. Both work.
Very acidic solutions will turn anthocyanin a red color. Neutral solutions result in a purplish color. Basic solutions appear in greenish-yellow. Therefore, it is possible to determine the pH of a solution based on the color it turns the anthocyanin pigments in red cabbage juice.