The brilliant red plumage on many bird species isn’t just pretty; it has a purpose. Male House Finches with bright red coloring, for example, more easily attract mates. And the scarlet shoulder patch on Red-winged Blackbirds helps males defend their territories. Red feathers have long posed one mystery, however: Scientists didn’t know how birds grew them. Today, a team of researchers thinks it may have finally figured it out.

With the exception of a few parrots and turacos, most birds acquire warm colors from molecules, called carotenoids, in the food they eat. But carotenoids produce a yellow pigment, meaning some birds must be able to transform it to a red one. Auburn University ornithologist Geoff Hill has spent nearly a decade trying to understand the biochemistry behind that color conversion. The breakthrough finally came courtesy of an international collaboration and a century-old experiment in bird breeding.

In the early twentieth century, breeders became enamored with the idea of producing a red version of the yellow canary. “They got their hands on a bright red bird from the Amazon called the red siskin,” says team member Joe Corbo, a biologist at Washington University in St. Louis. “Although it’s fairly distantly related, somehow they managed to get it to breed with a domestic canary.” The hybrid offspring had a mix of traits from both parents, including red feathers. That bird was then bred with another canary, as were the offspring of that pairing, and so on. Eventually, breeders had birds that were mostly canary, genetically speaking, with just enough siskin to make their feathers red.

To home in on the source of the red pigmentation, a lab led by Miguel Carneiro, a geneticist at Universidade de Porto in Portugal, looked at the genomes of Red Siskins, yellow domestic canaries, and their hybrids—red canaries. The researchers identified just two regions of the red canary’s genome that had been inherited from the Red Siskin. Then the ornithologists in Hill’s lab, together with the molecular biologists in Corbo’s lab, worked to ascertain just what the genes in those regions do.

One of the genes, called CYP2J19, creates an enzyme known to interact with carotenoids. Most birds carry it—the researchers found CYP2J19 expressed in the retinas of yellow canaries and domestic chickens (they surmise it allows them to better perceive red light). Birds like the Red Siskin and red canary, on the other hand, express that gene in their livers, skin, and feathers, which suggests that it’s critical for producing red plumage.

“The other genomic region was a little more puzzling because it doesn’t appear to encode any specific enzyme,” says Corbo. But then the team realized the genes in that region are involved with the development of skin and feathers. The team hypothesizes that birds need the CYP2J19 enzyme to turn the yellow carotenoid into a red one, but that they also need changes in this second genomic region in order for those pigments to become deposited into the feathers as they develop.

John McCormack, director and curator of the Moore Laboratory of Zoology at Occidental University, who was not involved in the study, says the findings reinforce the notion that evolution is a nuanced process. Gene mutations can be passed on through natural selection, but they alone don’t necessarily result in such readily observable traits as feather coloration. “A lot of evolution happens by changing the timing and the location of where already-existing gene products are expressed,” he says.

Hill, Corbo, and Carneiro plan to continue their investigation of the genetics underlying red plumage in a wider variety of red-feathered species. They want to completely understand how red pigments are delivered (or not delivered) to different parts of birds’ bodies, such as the retina, liver, skin, and feathers, and how different genes work together to govern that process.

“The cardinal, for example, is a very iconic and well-known red bird, but every once in a while in nature you see a yellow cardinal,” says Corbo. “These have been well documented, but they’re very rare.” The team suspects that yellow cardinals have a mutation in the same gene as the red canary, only preventing the growth of red feathers. To find out, they’ve recently gotten their hands on some genetic material from a yellow cardinal preserved in a natural history museum. They hope its plumage conceals insights.