White onion varieties are somewhat moister and don’t keep quite as well as yellow onions, which owe their color to phenolic flavonoid compounds. Red onions are pigmented by water-soluble anthocyanins, but only in the surface layers of each leaf scale, so cooking dilutes and dulls their color.