Birds may use the colour red to signal their fitness, a study has found.
Scientists have shown that genes for red feathers, beaks or feet play an important role in detoxification.
The discovery suggests that heightened redness may be a sign of mate quality, by indicating a bird's ability to clear poisons from its body.
The researchers studied zebra finches, whose males have a distinctive red beak. Female zebra finches are known to prefer those males with the reddest beaks.
Birds such as the zebra finch obtain yellow pigments called carotenoids from their diet of seeds or insects. Their bodies convert these pigments into the red ketocarotenoids that colour their beaks or plumage.
Dr Nick Mundy, from the Department of Zoology at Cambridge University, said: "It was known that birds have an unusual ability to synthesise red ketocarotenoids from the yellow carotenoids that they obtain in their diet, but the enzyme, gene or genes, and anatomical location, have been obscure.
"Our findings fill this gap and open up many future avenues for research on the evolution and ecology of red colouration in birds."
The scientists, whose research appears in the journal Current Biology, compared the genes of standard zebra finches with red beaks and a variety bred to have yellow beaks.
They found that yellow-beaked birds had multiple mutations in a cluster of three genes strongly linked to red colouration.
The same genes' code for enzymes, called cytochrome P450s, plays an important role in breaking down and metabolising toxic compounds, primarily in the liver.
In humans, they influence the way people respond to taking drugs.
Co-author Professor Staffan Andersson, from the University of Gothenburg in Sweden, said: "In sexual selection, red colour is thought to signal individual quality and one way it can do this is if the type or amount of pigmentation is related to other physiological processes, like detoxification.
"Our results, which link a detoxification gene to carotenoid metabolism, may shed new light on the debated honesty of carotenoid-based signals."
One or more of the "red" genes was also found to be active in the retina of the eye.
Birds have a range of pigments in the light-sensitive photoreceptor cells of their retinas that allow them to see many more colours than mammals.
The ability to manufacture red pigment may have evolved for colour vision in birds before it became an external display tool, said Dr Mundy.
Red eye pigments were found across all bird species, including those with no reddish hue to their bodies.