Dinosaurs went from drab to colorful fab just before 150 million years ago, according to a study published in the latest issue of the journal Nature.

The "Wizard of Oz"-type moment in evolution appears to coincide with the emergence of feathers.

Researchers determined this after studying pigment-containing organelles known as melanosomes. These specialized structures within cells in living organisms contain melanin, which is the most common light-absorbing pigment found in animals.

Photos: Dinosaurs of a Feather Come Together

"Black, brown and grey colors are melanin-based," co-author Julia Clarke told Discovery News. "In birds, melanin-based colors include a slightly larger range of reddish brown, brown, black, grey, black and many forms of iridescence."

Clarke is an associate professor at the University of Texas at Austin's Jackson School of Geosciences. She and her colleagues compared the melanosomes of 181 diverse living animals, including birds, mammals and reptiles, as well as 13 fossil specimens and all previously published data on this subject.

Before it was determined that diversity in the shape and size of melanosomes is associated with the evolution of melanin-based color in non-avian dinosaurs, birds and mammals. This diversity in dinos happened suddenly, just as small, meat-eating maniraptoran dinosaurs were evolving feathers, the study found.

Photos: 10 Unbelievable Dinos That Really Existed

"This shift is not seen close to the origin of dinosaur 'fuzz' or 'protofeathers,' but is only associated with feathers," Clarke said. "The shift seems abrupt and occurs before the origin of anything we would call avian flight."

While she and her team are not sure why dinosaurs experienced such a color explosion, Clarke said the dramatic change could have facilitated mate selection. Just as pretty, colorful birds today catch our eye, colorful exteriors would have probably grabbed the attention of non-flying dinosaurs and literal 'early birds' seeking sexual partners.

In these living specimens, color and the shape of the melanosomes are not linked in such a way that color can be reconstructed from melanosome shape alone. Melanosomes in Sinosauropteryx don't presently tell us if this animal was brown, blackish or grey. However, feathered dinosaurs are similar to birds, and scientists can estimate their color. Clarke et al.

Many of the genes involved in the melanin color system are also tied to basic functions such as food intake, reproductive behaviors, the "fight or flight" process and other things. So the researchers believe that the color explosion in certain dinosaurs might have been linked to larger changes in their anatomy and metabolism.

"What is most exciting is that tracking color could potentially offer insight into dinosaur physiology," Clarke said.

The research could, for example, help to reveal the precise bodily changes that took place just as non-avian dinosaurs were evolving into birds, and why those changes occurred in the first place.

Photos: Oldest Dinosaur Nursery Found

Color for color's sake is also of interest, allowing us to better recreate and envision what long-extinct animals looked like. This has been a challenge for researchers studying rather drab-looking fossils.

"The presence of pigment must not be confused with color, as even with a specific pigment being recognized, there are/were many factors that contribute to an organism's entire color palette," paleontologist Phillip Manning of the University of Manchester told Discovery News.

He continued, "Color is a function of the interaction of light with the surface structure and chemistry of a substrate (whether this be carapace, keratin, feathers, skin, scales or hair). The chemistry can be in part from pigments, but also from substances eaten by an organism, such as the pink of flamingos from their shrimp diet."

"There has possibly been wonderful color throughout the evolution of life on Earth," he concluded, "but whether the species alive could see or perceive it, as we or other species alive do today...that is a tougher question."