Red cabbage can act as a pH indicator as it contains a pigment called flavin (an anthocyanin).This is water soluble pigment and is also found in apple skin, grapes etc. Very acidic solution will turn anthocyanin to red colour. Neutral solution turns it to purple. Basic changes it to greenish yellow.