Prolonged storage in light can cause uncooked potatoes to turn green. Green potatoes may contain a substance called solanine, which can have a bitter flavor and can be toxic. If you've purchased potatoes that have turned green, be sure to trim off the green areas before using. To prevent potatoes from greening, they should be stored in a dark, cool place that is well ventilated. Such storage will prevent potatoes from "sprouting," too, but avoid storing potatoes with onions. Always trim sprouts before cooking potatoes. Once cut, uncooked potatoes can take on bluish or dark tints. Potatoes that become discolored in this way are safe to eat, and the color usually disappears when the potato is cooked. To prevent cut potatoes from discoloring, immerse them in cold water until ready to use, for up to two hours. However, extended storage in cold water is not recommended as it can result in loss of some of the potatoes' water-soluble nutrients. Cooked potatoes are subject to discoloration, too. Sometimes, a gray-blue or blackish area develops as the cooked potato cools. This is harmless, and any discolored area can simply be cut away.