Onions have different colors because they are exposed to different levels of sunlight. The top of the onion skin is green, while the part that is below ground is actually white. When onions absorb light through their leaves, they turn yellow because the leaf contains chlorophyll which absorbs light.