Pop quiz: Why are flamingos pink?

If you answered that it’s because of what they eat—namely shrimp—you’re right. But there’s more to the story than you might think.

Animals naturally synthesize a pigment called melanin, which determines the color of their eyes, fur (or feathers) and skin. Pigments are chemical compounds that create color in animals by absorbing certain wavelengths of light while reflecting others. Many animals can’t create pigments other than melanin on their own. Plant life, on the other hand, can produce a variety of them, and if a large quantity is ingested, those pigments can sometimes mask the melanin produced by the animal. Thus, some animals are often colored by the flowers, roots, seeds and fruits they consume

Flamingos are born with gray plumage. They get their rosy hue pink by ingesting a type of organic pigment called a carotenoid. They obtain this through their main food source, brine shrimp, which feast on microscopic algae that naturally produce carotenoids. Enzymes in the flamingos’ liver break down the compounds into pink and orange pigment molecules, which are then deposited into the birds’ feathers, legs and beaks. If flamingos didn’t feed on brine shrimp, their blushing plumage would eventually fade.

In captivity, the birds’ diets are supplemented with carotenoids such as beta-carotene and and canthaxanthin. Beta-carotene, responsible for the orange of carrots, pumpkins and sweet potatoes, is converted in the body to vitamin A. Canthaxanthin is responsible for the color of apples, peaches, strawberries and many flowers.

Shrimp can’t produce these compounds either, so they too depend on their diet to color their tiny bodies. Flamingos, though, are arguably the best-known examples of animals dyed by what they eat. What others species get pigment from their food? Here’s a quick list:

Northern cardinals and yellow goldfinches: When these birds consume berries from the dogwood tree, they metabolize carotenoids found inside the seeds of the fruit. The red, orange and yellow pigments contribute to the birds’ vibrant red and gold plumage, which would fade in intensity with each molt if cardinals were fed a carotenoid-free diet.

Salmon: Wild salmon consume small fish and crustaceans that feed on carotenoid-producing algae, accumulating enough of the chemical compounds to turn pink. Farmed salmon are fed color additives to achieve a deeper shades of red and pink.

Nudibranchs: These shell-less mollusks absorb the pigments of their food sources into their normally white bodies, reflecting the bright colors of sponges and cnidarians, which include jellyfish and corals.

Canaries: The birds’ normal diet doesn’t alter the color of its yellow feathers, but they can turn a deep orange if they regularly consume paprika, cayenne or red pepper. These spices each contain multiple carotenoids responsible for creating and red and yellow.

Ghost ants: There’s not much more than meets the eye with ghost ants: these tropical insects get their name from their transparent abdomens. Feed them water mixed with food coloring and watch their tiny, translucent lower halves fill up with brilliantly colored liquid.

Humans: Believe it or not, if a person eats large quantities of carrots, pumpkin or anything else with tons of carotenoids, his or her skin will turn yellow-orange. In fact, the help book Baby 411 includes this question and answer:

Q: My six-month-old started solids and now his skin is turning yellow. HELP! A: You are what you eat! Babies are often first introduced to a series of yellow vegetables (carrots, squash, sweet potatoes). All these vegetables are rich in vitamin A (carotene). This vitamin has a pigment that can collect harmlessly on the skin, producing a condition called carotinemia.

How to tell that yellow-orange skin isn’t an indication of jaundice? The National Institutes of Health explain that “If the whites of your eyes are not yellow, you may not have jaundice.”