Eating green potatoes that have been stored for too long in bright light is a big mistake. They can make you very ill - not because of the green pigment which is chlorophyll and is no more harmful than eating green lettuce, but because potatoes that are exposed to light produce a toxic glycoalkaloid called solanine below their skin. It's most likely a natural defence mechanism, to protect the plant from insect pests and fungal pathogens.
This is a section taken perpendicular to the potato surface, through those green cell layers. It's been stained with a fluorescent dye that has a particular affinity to the toxin, which fluoresces brightly in its presence, so you can see glowing crystals of solanine inside these cell layers. The rounder, translucent greenish objects are starch grains.
Wild potatoes have a much higher solanine content than cultivated varieties. Part of the domestication process of many of our crops has been selective breeding to remove natural toxins that protect the plants from pests and diseases - but also poison people. That's why we have to use applied pesticides on crops, to replace their natural equivalents that have been bred out of the plants, whose defences have been weakened in order to make them edible: it's a vicious circle!