Red onions get their color from anthocyanins. That's the same group of compounds that color the cabbage in this purple cabbage slaw or rainbow poke bowl, the purple in purple sweet potatoes and ube cookie recipes, and the color-changing magic of butterfly pea flower in an Empress gin cocktail.