Imagine you’re a male veiled chameleon (Chamaeleo calyptratus) facing down another male. As you approach your opponent, you see his yellow body stripes get brighter and begin to flash, contrasting against his blue-green belly. When you get closer, you flash the colors on your head. But this doesn’t make him back down, and the two of you end up in a fight, butting heads, shoving and biting until one of you backs off.

The chameleon’s color-changing ability is famous — so much so that it’s even inspired a funny line of paint commercials. But this is a useful talent, helping the animals to do things like hide from predators or communicate with each other. But what’s clear to chameleons isn’t always clear to the humans that encounter them, and the veiled chameleons’ color battles are a great example.

It turns out that these chameleons, an arboreal species found near the border of Yemen and Saudi Arabia, are talking to each other in those colorful moments before a battle. And now Russell Ligon and Kevin McGraw of Arizona State University have employed high-definition video and mathematical modeling to decode those color shows. Their study was published December 10 in Biology Letters.

Ligon and McGraw started with 10 male veiled chameleons, setting up a series of matches between them, round-robin style. They recorded the matches and monitored 28 spots on each chameleon for brightness and color change. In only 17 of the 45 contests did both chameleons undergo rapid color change and display aggressive behavior. But what the animals did before the match communicated a lot of information about what would happen next.

When a chameleon is getting ready to fight but still fairly distant from a potential opponent, it presents its side to the other male and starts flashing its body stripes. Those stripes can accentuate the chameleon’s size, and their brightness signals to the other animal its willingness to fight. Those with the brightest side stripes were the most willing to engage in battle, Ligon and McGraw found.

If the side stripes don’t deter an opponent, the two chameleons get closer, and the colors on their heads start to get brighter and change in color. The one with the brighter and more rapidly changing colors at this stage was the chameleon most likely to win, the lab battles revealed.

“Taken together, these correlational findings represent the first demonstration that multiple components of rapid colour change can be used to signal different aspects of competitive behaviour (e.g. motivation and fighting ability),” the researchers write.

Ligon and McGraw speculate on potential explanations for the link between color and battle ability: One possibility is that color expression might be related to physiological processes, such as energy reserves or hormones, that directly affect a chameleon’s fighting prowess. But the link might be less direct, instead reflecting an evolutionary pressure to signal strength when it can be backed up.

Still unknown, though, is whether these color changes or similar ones might communicate other information in different scenarios, such as whether a female might be able to use them to assess a male’s potential as a mate.