In 350 B.C., Aristotle sat down and wrote a 4,700-word ode to bird eggs. One paragraph was devoted entirely to describing their striking diversity of color. “Some eggs are white, as those of the pigeon and of the partridge; others are yellowish, as the eggs of marsh birds; in some cases the eggs are mottled, as the eggs of the guinea-fowl and the pheasant; while the eggs of the kestrel are red, like vermillion,” he observed.

Our fascination has only grown since—thanks, in large measure, to the Easter egg industry. In the late 19th century scientists began to investigate the chemistry of bird eggshell color. In the 1970s, they arrived at a startling discovery: The entire gamut of eggshell colors and markings is the result of just two pigments—one that’s reddish-brown and another that’s bluish-green—set against the pristine white backdrop of the universal calcium carbonate shell. “It’s like going to Home Depot, buying only two paints, and then generating all egg colors based on just those two paints,” says Mark Hauber, an animal behaviorist at Hunter College.

But how can just two pigments produce the range of colors visible on birds’ eggs—everything from olive green to strawberry pink to, dare we say it, robin’s egg blue? Until recently, scientists weren’t sure—nor did they fully understand how the range of colors might influence a bird’s perception of these eggs.

To crack these unanswered questions, Hauber and his colleagues undertook the largest quantitative study of bird egg color ever conducted, which they describe in the May issue of Biology Letters. They visited natural history museums and took measurements of the reflectance spectra of eggs from 636 different species, representing nearly all avian orders. They used those values to plot how birds—which can see in the ultraviolet as well as in the visible spectrum—perceive eggs. From a bird’s point of view, eggs are 200 to 400 times less diverse in perceivable color than feathers, the researchers found. “It’s astonishing and exciting to think that, for birds, eggshell color is so limited, yet people have been describing eggs as so diverse for such a long time,” says Daniel Hanley, a postdoctoral fellow in behavioral ecology and evolution at Palacky University in the Czech Republic and lead author of the study.

Next the researchers used a color-mixing computer model to determine how the two known pigments—biliverdin, responsible for blue-green hues, and protoporphyrin, which accounts for brownish reds—could produce all the colors of the eggshell rainbow. To do this, the model—which took into account such variables as reflectance—began with three examples of eggshells that show pure pigment or lack thereof: an American Robin’s blue egg, a Peregrine Falcon’s brown egg, and a Northern Fulmar’s white egg.

Using this information, the model gradually mixed the pigments and produced a prediction of all of the possible colors that could result. When combined in different ways and set against the shell’s white backdrop, the researchers watched as the two pigments successfully created the full range of eggshell colors and patterns. A heaping of blue biliverdin and a pinch of brown protoporphyrin generates a light bluish-green, for example.

While birds seem to excel at making the most of their limited pigmentation paint kit, this raises the question of why bird evolution favored those two particular pigments. “Many, many pigments exist in general, so one question we’ll now be able to ask is, why aren’t all those other colors being produced?” Hanley says.

Finding that answer will require further study, but it could simply be that once blue and brown pigments were introduced to birds’ biological repertoire, all of their egg needs—camouflage, anti-microbial defense, protection from solar radiation, easy recognition—had been met. Birds, in fact, might not have been the first to stumble across this simple formula. According to new evidence, 150-million-year-old dinosaur eggs likely sported the original robin’s egg blue.