The discovery that dinosaurs were feathery, not leathery, means we've had to rethink how they might have looked - and now there's evidence that at least one dinosaur could have been as brilliantly coloured as some of the most jewel-hued modern birds.

Caihong juji, a name that means "rainbow with the big crest" in Mandarin, was a tiny, duck-sized dinosaur from China. The fossil it left behind indicates a bony crest on its beak, and a brilliant, iridescent ruff of feathers around its neck - the earliest evidence of a colour-based display.

The international team of researchers who described the new dinosaur believe that these features may have something to do with attracting mates.

"Iridescent colouration is well known to be linked to sexual selection and signalling, and we report its earliest evidence in dinosaurs," said researcher Julia Clarke of the University of Texas Jackson School of Geosciences.

"The dinosaur may have a cute nickname in English, Rainbow, but it has serious scientific implications."

The research team determined the possibility of iridescent feathers, coloured like those of a hummingbird, by the fossil. The slab of rock, found by a farmer in 2014, contained nearly a complete skeleton.

While the feathers themselves had long since decayed, they left impressions in the rock around the fossilised bones.

caihong juji skeleton feathersThe impression of the skeleton can be seen in brown and the feathers in black. (Hu, et al., 2018)

"I was shocked by its beautifully preserved feathers, even though I had seen many feathered dinosaur fossils previously," co-author Xing Xu of the Chinese Academy of Sciences told National Geographic.

It's difficult to tell for certain what colour the feathers were, but the fossil was so detailed that it preserved the shape of the melanosomes, the organelles inside cells responsible for pigmentation.

And when the team compared these melanosomes to those of living birds, they most closely resembled melanosomes found in the iridescent, rainbow-hued feathers of hummingbirds.

Caihong juji lived around 161 million years ago, in the Jurassic, and it combines older features with new. The sexually selected crest on the beak had been seen in earlier birds. But the iridescent feathers aren't the only new feature.

The dinosaur marks the earliest appearance discovered so far of asymmetrical feathers. In modern birds, these appear in the wings and are used for flight control, but in Caihong juji, they appear in the tail - suggesting that early birds may have had a different flying style.

It was also rather different even from its closest relatives, with a long, narrow skull and short forelimbs, proportioned more like birds today than the dinosaur group it belonged to.

"This combination of traits is unusual," Clarke said.

"It has a rather velociraptor-looking low and long skull with this fully feathered, shaggy kind of plumage and a big fan tail. It is really cool… or maybe creepy-looking depending on your perspective."

Further study of the dinosaur will need to be conducted to try to figure out how and why Caihong juji evolved such a distinctive and unusual set of characteristics while other dinosaurs did not.

The research has been published in the journal Nature Communications.