Charlie and the Chocolate Factory gives new meaning to “you are what you eat.” In the classic kids’ book, a girl named Violet Beauregarde chews some experimental blueberry-flavored gum—and it turns her blueberry-blue. But for some animals, that’s not too far from the truth: they get their colors from the food they eat. Here are eight critters that get their hues from their diet, plus two honorable mentions: a bird that’s shinier when it eats bugs, and a garden plant that switches between pink and blue.

1. BLUE-FOOTED BOOBIES

Native to warm waters of the eastern Pacific, blue-footed boobies (above) have, well, bright blue feet. They use this fancy footwear to attract mates via an awkward dance. The blue color comes directly from carotenoid pigments in their fishy diet, and healthier birds can afford to expend more pigment to intensify their foot coloration. So, a bird with brighter feet is a more attractive partner. 

2. EASTERN EMERALD ELYSIAS

Karen N. Pelletreau et al. via Wikimedia // CC BY 4.0

Its name is straight out of a fantasy novel, and that’s not even the coolest thing about this marine slug-like animal. The eastern emerald elysia has turned itself, at least in part, into a plant. It’s green, it’s shaped almost exactly like a leaf, and it can do something that animals usually can’t do: make food from the sun.

Plants are green because their cells have special green parts called chloroplasts that make energy from the sun. When the eastern emerald elysia eats some algae, it adds insult to injury by stealing the algae’s chloroplasts. Then it basks in the sunlight and absorbs the food that the chloroplasts make. It’s able to keep these stolen parts functioning for nearly a year—enough time so that it may never need to eat algae again.

3. SALMON

Salmon flesh has such a lovely hue that we call it, well, salmon pink. These fish get their color from the small shellfish they eat. Farmed salmon are fed natural or synthetic pigments so that their meat retains this familiar tint.

4. FLAMINGOS

Everyone knows that flamingos are pink and bluebirds are blue, right? Well, not really: Flamingos are definitely pink, but bluebirds’ blue color is an illusion.

Birds have different ways of looking colorful. A bluebird’s feathers have special structures that break up light and reflect just the blue parts. This makes them look blue—but only when light is hitting them in just the right way. If you take a bluebird feather and shine a light behind it, the feather will appear brown. The same is true of most other blue and green birds, from blue jays to green parrots.

Flamingos, on the other hand, have feathers that stay pink no matter which way you look at them. That’s because they’re full of pink-red pigments called carotenoids—carrots are orange because they contain a type of carotenoid. Flamingos get this pink stuff from the shrimp that they eat. If they don’t consume the right food, they’ll turn grayer. Zookeepers have to feed their flamingos food with the right pigments to keep them rosy.

5. GOLDFINCHES

Many other birds get their hues from carotenoid pigments. That’s true of American goldfinches, which are blazing yellow in breeding season. Female goldfinches size up males based on the vibrancy of their yellow: Brighter males are healthier and have better diets, so they’re more attractive.

6. CEDAR WAXWINGS

Cedar waxwings are small, sleek songbirds. Their tails usually have yellow tips—but some have red tails, and it’s all our fault.

Cedar waxwings are native to North America, and they love eating berries. A few decades ago, people brought Asian honeysuckle varieties to North America. These plants spread throughout the forests, and they produce big red berries that are impossible for a hungry waxwing to resist. The berries are rich in a reddish pigment that builds up in waxwing tails, turning them from yellow to orange.

7. NUDIBRANCHS

Related to snails, nudibranchs live in the ocean, and they’re mind-blowingly colorful. Really: feast your eyes on these hues. They’re so colorful, in fact, that there’s a blog matching different species to David Bowie’s outfits.

Many nudibranchs get their bright colors from their prey. One species, the red sponge dorid, is bright red and probably gets its pigment from the red sponges it eats. This has the added benefit of giving the red sponge dorid some amazing camouflage when it’s crawling on its spongy food.

8. FRILLED DRAGONS

Remember that scene in Jurassic Park when a neck-frilled dinosaur terrifies the hapless hacker Dennis Nedry, then spits poison on him? The movie’s creators got their inspiration from Australia and New Guinea’s frilled dragons—also known as frill-necked lizards. These remarkable reptiles flare their huge frills when they’re scared, or as part of territorial or courtship displays.

Frilled dragons’ frills come in different colors, from red to orange to yellow. The colors depend on their geographical location—and the variation is probably because of the different amounts of pigment in their prey.

HONORABLE MENTION #1: HUMMINGBIRDS.

Many hummingbirds have shiny, iridescent patches of feathers. These hues don’t come from their diet; they’re the result of specially structured feathers that reflect light in amazing ways. But even though hummingbirds don’t get their color directly from their food, their diet has a strong influence on how shiny and bright they’ll be. 

Anna’s hummingbirds are tiny, fast-moving birds that live along the Pacific Coast of North America. Their foreheads and chins are iridescent red-purple. When they’re staking out territory, they stick up these feathers and enthusiastically show them off. To keep up their high-energy lifestyles, these birds eat sugary flower nectar. But there’s one problem with this sweet diet: Hummingbirds need protein to make their shiny feathers, and there’s not a lot of protein in nectar. Another option is to catch and eat insects, but this takes a LOT of energy. Scientists have found that Anna’s hummingbirds on higher-protein diets have shinier, redder crowns.

HONORABLE MENTION #2: HYDRANGEAS

Plants can also change color depending on their diets. Hydrangeas are familiar garden flowers, and they’re like living mood rings. If a hydrangea plant is absorbing aluminum from the soil, it turns bubblegum pink. In the absence of aluminum, it’s cotton candy blue. Gardeners adjust the colors by tweaking the soil pH—acidic soil promotes blue colors and basic promotes pinks.

All photos courtesy iStock unless otherwise noted.