Tiffany blue, pale green, periwinkle: bird eggs come in a variety of stunning hues. Colorful, speckled eggshells always appeared to be a trait unique to avians — but researchers recently found a connection that could date back millions of years.

Birds inherited their egg color from dinosaurs, which similarly laid eggs in open nests, according to a new study published Wednesday in the journal Nature. Yale University, the American Museum of Natural History and Germany’s University of Bonn teamed up to analyze eggshells.

Researchers wanted to find out how egg color has changed over time “and what we can infer from modern birds and dinosaurs,” paleontologist Jasmina Wiesmann, a Yale graduate student and lead author of the study, told Fox News.

“The egg colors of birds reflect characteristic preferences in nesting environments and brooding behaviors,” Yale explained. “Modern birds use only two pigments, red and blue, to create all of the various egg colors, spots, and speckles.”.

OCTOPUS MOM ENTERS DEATH SPIRAL BEFORE EIGHT-ARMED BUNDLES ARE BORN

In 2016 and 2017, researchers used laser imaging to study fossilized eggshell samples from non-avian dinosaurs, modern birds and a stem bird to look for the pigments, Wiesmann explained. Stem birds, she said, were on the way toward what is considered modern birds and had “mixed characteristics,” like teeth.

Yale said the team discovered the pigments “in eggshells belonging to Eumaniraptoran dinosaurs, which include small, carnivorous dinosaurs such as Velociraptor.”

WOMAN SNAPS STUNNING PHOTO OF VENOMOUS COTTONMOUS SNAKE BARING ITS FANGS

Birds are also considered Eumaniraptorans, New Scientist reports, explaining it's a broad group of different types of dinosaurs.

Wiesmann, who hopes her study can be used for future research, offered an explanation for how egg colors may have adapted.

“We infer that egg color co-evolved with open nesting habits in dinosaurs,” she said in a statement. “Once dinosaurs started to build open nests, exposure of the eggs to visually hunting predators and even nesting parasites favored the evolution of camouflaging egg colors, and individually recognizable patterns of spots and speckles.”