In the mountains between Spain and France, wild snapdragons have been tweaking their appearance for millions of years - not for gardeners, but for bees. The flowers have learned to paint themselves in just the right shades of yellow and magenta so that bees will visit and spread their pollen. A slight change in shade can mean the difference between a flower that reproduces and one that doesn't.

Researchers at the John Innes Centre in England, working with scientists in Austria, China, and Australia, have discovered exactly how snapdragons achieve this bee-attracting look. Their study, published in the journal Science Advances, found that seven genes work together to control the flower's coloring - three genes paint the magenta parts, while four genes paint the yellow.

The scientists took advantage of a remarkable natural laboratory in the Pyrenees, where two varieties of snapdragon meet. One type has yellow flowers with a magenta dot in the center, like a bullseye for bees. The other has the opposite pattern: magenta flowers with a yellow center. When these two varieties mix, their genes combine to create unexpected colors - orange and white flowers that might look pretty in a garden but don't attract bees as well.

The zone where these varieties mix is remarkably narrow - just one kilometer wide, about six-tenths of a mile. That's because natural selection keeps it that way. Flowers with hybrid colors don't get as many bee visits, so their genes spread less successfully. The genes that create the original, bee-friendly patterns keep winning out.

What surprised the researchers was how subtle these color differences actually are. The effects of individual genes can be so slight that humans can barely tell the difference. But bees can detect them, and that's what matters for evolution. As Dr. Desmond Bradley, one of the study's lead authors, explained: "Even those patterns that we could hardly discern can be distinguished by the bee in the hybrid zone."

The research suggests that tiny genetic tweaks add up. Four genes working together create a smooth gradient of yellow - a gentle blend in one variety, a steeper transition in the other. Each gene contributes just a little bit, but together they shape the pattern bees respond to.

The findings may help explain how other patterns in nature develop, from butterfly wing colors to fruit fly egg shapes. Molecular gradients like these control many biological processes, and scientists now have a better understanding of how natural selection hones them over time.

So the next time you see a snapdragon - whether in a garden or a mountain meadow - you're looking at millions of years of floral fashion, carefully tuned by evolution to catch a bee's eye.