Brainy member BrittLiv explains:
"Naturally, red cabbage has a colour somewhere between red and purple, depending on the pH-value of the soil it is growing in. This colour change occurs due to the pigment flavin, which belongs to a group of water soluble plant pigments called anthocyanins (For those of you, that don't know what the pH value refers to, it is the measure of the acidity (pH < 7) or basicity (pH > 7) of an aqueous solution).
In this Instructable, we are making use of the fact, that flavin is a natural pH indicator and that egg white has a pH value of about 8. These slightly alkaline condition result in a colour change to a blueish-green."
Previous, unclear science explanation:
The purple pigment in red cabbage is called anthocyanins and can change colour in response to changes in pH.
The acidity in red cabbage causes the pigmentation to be purplish, but when introduced to an alkaline condition (like the whites of eggs) changes to a blueish-green.
To make your own green eggs pour a small amount of the red cabbage juice into your bowl of egg white and gently whisk together, you should see a colour change almost immediately.