More from Corriher: Use science to make better low-fat oven fries
The compounds that give fruits and vegetables their red color are very sensitive to acidity. As long as they are acidic they stay red, but when they become non-acidic they turn blue. When you sauté red cabbage, the acids evaporate off and it can turn blue. All you have to do is add lemon juice or vinegar to bring back the bright red color.
For this same reason, you may have seen a blue circle around the cherries in cherry muffins. To prevent this discoloration, add a little lemon juice or use an acidic ingredient like sour cream or buttermilk in the muffins.
Even walnuts have some of these compounds just under their skins so walnuts can discolor a dish or give it a blueish cast. It is easy to prevent this discoloration from walnuts -- just roast the nuts before using. The temperature in roasting is high enough to convert these compounds to others that do not change color.