Higher levels of these alkaloids can give potatoes a bitter taste and result in digestive problems. Very high levels can also cause neurological problems and can potentially be life threatening, though these cases are rare.
Stressful growing conditions and prolonged exposure to light can cause the alkaloid levels to steeply increase. Exposure to light also triggers chlorophyll formation in the skin and upper layers of the potato, causing the potato to turn - you guessed it - green.
Since they're both related to light exposure, greenish skin can indicate high alkaloid levels.
Again according to Harold McGee, you can still eat these potatoes if you peel away all the green skin and surface layers of the potatoes. If the greening is very deep or the potato tastes noticeably bitter, it should be discarded.
(Image: Emma Christensen for the Kitchn)