Dinosaur world 'more colourful than we thought'
Why do some birds lay colourful eggs? From pale blue to speckled red, they come in every shade and hue.
The answer, say scientists, is that coloured eggs evolved millions of years ago in birds' ancestors, the dinosaurs.
The patterns and colours may have served to camouflage eggs from predators as white eggs stand out more against darker backgrounds.
Thus, the likes of Oviraptor may have sat on eggs of the darkest blue rather than plain white ones.
"The dinosaur nesting world was more colourful than we thought," Dr Jasmina Wiemann of Yale University told BBC News.
"We think that camouflage is one of the main drivers."
The researchers detected the same two pigments that are present in colourful birds eggs in a group of dinosaurs called eumaniraptorans.
Comparisons with the eggs of modern birds suggest the clawed predator Deinonychus laid a blue egg with brown blotches.
The birdlike feathered Oviraptor had eggs that were a dark blue-green, like an emu.
The research, published in the journal Nature, suggests that egg colour provided an evolutionary advantage to dinosaurs that had nests with exposed eggs, rather than burying them as alligators and turtles do.
Modern birds inherited this ability.
"We are looking at a single evolutionary origin of egg colour," said Dr Wiemann. "It seems as if egg colour co-evolved with open nesting habits, which is quite neat."
Follow Helen on Twitter.