Because, when potato's are exposed to sunlight they will form a green tint. Most times that is nothing more than Chlorophyll which is harmless, but it can also be the toxin Solanine which most times is found just under the skin or within the skin of the potato but can sometimes also be found with the body of the potato. It's a deadly toxin, one that can be fatal with as little as half a gram for a 200-pound man, and No, cooking doesn't get rid of it.

Phil