The pigments that cause purple coloring in leaves (as well as fruits like blackberries and blueberries) are called anthocyanins, and many are powerful antioxidants — meaning they’re good for humans as well as plants. Purple coloring can also indicate a lack of nutrients, namely phosphorus. The cause is the same — anthocyanins — but in this case, the accumulation of anthocyanins is a “malfunction” caused by phosphorus starvation.