It comes down to carotenoids, which are a type of pigment used in animals for crucial functions like vision, bone growth and vitamin production. All known animals obtain these by eating the plants, algae and fungi that naturally synthesize the orange-red compounds.

Back in 2010, University of Arizona biologists researcher Nancy Moran and Tyler Jarvik discovered that pea aphids can make their own carotenoids, like a plant. “What happened is a fungal gene got into an aphid and was copied,”said Moran in a press release.

Entomologist Alain Robichon, of the Sophia Agrobiotech Institute in France, wanted to find out why the insects make such metabolically expensive chemicals.

Carotenoids are responsible for aphid body color, and the researchers found that insects changed color depending on environmental conditions. In optimal environments, aphids make a medium amount of carotenoids and come out orange. In the cold, the insects have a high level of carotenoids and are green. In areas with limited resources, aphids are almost devoid of the pigment and are born white.