New research has changed the theory of how chameleons change the color of their skin to avoid danger.

According to BBC News, authors of a study published in the journal Nature Communications suggest the reptile uses "selective mirror" crystals in its skin cells. The previously held theory regarding the chameleon involved pigmentation.

"These colors are generated without pigments, via a physical phenomenon of optical interference. They result from interactions between certain wavelengths and nanoscopic structures, such as tiny crystals present in the skin of the reptiles," study senior author Michel Milinkovitch, a genetics and evolutions professor at the University of Geneva, said in a press release. "These cells, which contain larger and less ordered crystals, reflect a substantial proportion of the infrared wavelengths."

For their study, the researchers identified a cell called the "iridophore" while peering into an electron microscope. The cell's crystals consistently formed a pattern that reflected a single color.

"When you see this with the eye of a physicist, you know it will have an effect on light," Milinkovitch told BBC News. "The net effect is that it will work as a selective mirror.

"Light will go through except for very specific wavelengths. If the distance between the layers is small, it reflects small wavelengths, like blue; if the distance is large it reflects larger wavelengths - for example, red."

The study caught the attention of Devi Stuart-Fox, a senior lecturer at the University of Melbourne who is an expert on the subject.

"We know that other lizards change color by changing the size and spacing of those crystals - but this paper is the first demonstration in chameleons and demonstrates it very convincingly," she told BBC News. "What is really novel about this study is that it shows that there are two layers of these iridophores, not just one. And the crystals in the deeper layer affect not just visible color but also how the skin reflects the near-infrared - a part of the spectrum of sunlight that neither we nor chameleons can see."