A fossil of a bat species known as Palaeochiropteryx found in Messel, Germany is seen in an undated handout picture courtesy of the Senckenberg Research Institute. The fossil is estimated to be about 49 million years old. Scientists have figured out how to know the color of an extinct creature based on microscopic structures in fossils that divulge pigment, and on Monday disclosed for the first time the fur color of extinct mammals: two of the earliest-known bats.

Previously, determining the color of an ancient animal was a puzzle for scientists. But in a new study, researchers reveal the color of 50-million-year-old bats, using just their fossils.

Thanks to microscopic structures in the fossils, scientists determined that these ancient bats were reddish-brown, according to a study published Monday in the journal Proceedings of the National Academy of Sciences.

"Biologists know a lot about living animals because of color: what sort of environment they live in, how they protect themselves or how they attract mates," study author and Virginia Tech paleobiologist Caitlin Colleary told Reuters.

"But since so little is preserved in the fossil record, the color of extinct animals has always been left up to artists' interpretations, and important information regarding behavior has been considered inaccessible,” Ms. Colleary said.

Melanin, the pigment that gives skin, hair, feathers, and eyes distinctive hues, was also the key for ancient animal coloring.

Scientists spotted tiny structures in the fossils that reminded them of melanosomes, the organelles in cells that contain melanin.

"Very importantly, we see that the different melanins are found in organelles of different shapes: reddish melanosomes are shaped like little meatballs, while black melanosomes are shaped like sausages," said Jakob Vinther, study author and molecular paleobiologist at the University of Bristol in a university release. “We can see that this trend is also present in the fossils.”

"This means that the correlation of melanin colour to shape is an ancient invention, which we can use to easily determine colour from fossils by simply looking at the melanosome shape," Dr. Vinther said.

There had been some debate in the scientific community about whether the structures in the fossils were actually melanosomes, or were simply fossilized bacteria. This new study answers that question. The research team found chemical evidence of melanin, confirming the structures as melanosomes.

"This is a great leap forward in our understanding of how fossils are preserved. We now know how melanin is preserved and we have the methods to confidently detect it,” said Vinther in the release.

Although this chemical examination is new, this isn’t the first time scientists used these techniques. As Reuters reported:

Vinther also has used the method to study colors in dinosaurs, fish, amphibians and fossil squid ink. The method was first described in 2008 regarding a 105-million-year-old black-and-white striped feather from Brazil and also showed that a winged dinosaur from China, Microraptor, boasted iridescent feathers.

And more can be learned from this pigment.

"We have now studied tissues from fish, frogs, and tadpoles, hair from mammals, feathers from birds, and ink from octopus and squids. They all preserve melanin, so it's safe to say that melanin is all over the place," Colleary said in the release. "Now we can confidently fill in some of the original colour patterns of these ancient animals."

The bats in this study, Palaeochiropteryx and Hassianycteris, roamed the Earth in the Eocene Epoch, 56 to 33.9 million years ago. These specimens roosted in a tropical forest beside a lake in what is now Germany.