In the 1300s, Spanish explorers discovered a small bird living in the islands off the western coasts of Portugal and Morocco, with dull green feathers but a sweet lyrical voice. The bird became fashionable in the courts of Spain and England, and people started breeding it, gradually changing its plumage to a wide variety of colors, from dark black to bright yellow. It’s the latter that the bird is most associated with. It is, of course, the canary.

Throughout those centuries of breeding canaries, one color remained elusive—red. The birds traversed the rainbow, but no hint of red had ever shown up in their feathers. So in the 1920s, German breeders decided to cross canaries with a closely related species—the red siskin of Venezuela. They then mated the hybrids with more canaries, selecting offspring with red feathers, but as few other siskin traits as possible. The result, after many generations, was the ‘red-factor canary’—a bird that looks exactly like a typical yellow canary, but with bright red plumes.

“The canary thus became the first animal that was purposely genetically modified by moving the genes from another species into it,” says Geoffrey Hill from Auburn University.

Decades later,  his team, including Joseph Corbo from Washington University School of Medicine and Miguel Carneiro from the University of Porto, have finally learned which gene the breeders moved across.

By sequencing and comparing the genomes of red siskins, red factor canaries, yellow canaries, and wild green canaries, the team identified over 15,000 genetic variants that are associated with red color, most of which are confined to two small stretches of DNA. One of these regions contains a gene called CYP2J19, which is switched on in the birds’ skin and liver, and is a thousand times more active in the red canaries than the yellow ones. That’s an important clue.

Red siskins and red factor canaries get their distinctive colors by converting yellow chemicals (carotenoids) in their food into red chemicals (ketocarotenoids) in their feathers. This transformation is carried out by an enzyme called a ketolase, and it takes place mostly in the skin and liver. Given how active CYP2J19 is in these organs, it’s almost certainly the gene that makes the ketolase.

It’s what paints the birds red.

If that wasn’t evidence enough, another team led by Nicholas Mundy at the University of Cambridge independently honed in on the same gene after studying zebra finches. These birds normally have red beaks, but some have yellow ones. As Mundy’s team discovered, that’s likely because of mutations in CYP2J19 that stop the gene from activating in the beak.

Natasha Bloch from University College London notes that neither team actually disabled the CYP2J19 gene to see if that de-reddened the birds. But they “have done all the proper experiments short of that, and left me with no doubt that they have found the proper gene responsible for the switch to red color,” she says.

“Is the CYP2J19 gene responsible for all ketocarotenoid-based red coloration across birds, from flamingos to extinct pink-headed ducks?” asks Mary Caswell Stoddard from Harvard University. “Are parrots, which lack carotenoids in their feathers and instead use a unique pigmentation system to make red, missing the CYP2J19 gene or is it merely turned off? These are the exciting questions we can now begin to explore.”

Other genes are probably involved too. Hill’s team found that the red color of siskins and canaries also depends on a cluster of genes involved in skin development. And CYP2J19 isn’t just a gene for making red feathers either. It’s switched on in the retina of many other birds, where it produces a red pigment that helps the animals to distinguish between different colors.

So nearly all birds see red, and nearly all could be red. They have the basis of red feathers and beaks right there in their eyes, waiting to be repurposed. And yet, only a few species have done so. Why?

The answer probably involves sex. Red colors are a potent sexual signal in the bird world. Their vibrancy is a reliable indicator of health, and females are most attracted to the reddest males. Bloch, who studies the evolution of color, says, “Finding the genes responsible for color brings us one step closer to understanding how male traits and female preferences co-evolve and whether they share a common genetic basis.”

There are economic reasons to identify such genes, too. “Red carotenoids are big business and they are getting bigger all the time,” says Hill. Astaxanthin, the red pigment in bird retinas, also doubles as a red food colorant. It’s what makes farmed salmon pink, and is the most expensive part of feeding these fish. Mostly, astaxanthin is made from petrochemicals. But perhaps scientists could eventually find a way of harnessing bird ketolases “to produce red carotenoids on a commercial scale,” says Hill.