Well, the fact that they have a pattern rather than one solid color does help them hide, because a more complex pattern breaks up their silhouette when the background is busy (leaves). Same thing for zebras or leopards. A changeable color can confuse predators too. Chams have other features that help them hide...the leaf walk, their ability to sit completely still yet hunt or watch for predators without giving themselves away (those wonderful independent eyes), their eyelids that cover almost all of their eye (many predators key in on eye movement or eye shine). The issue is what triggers the color change. Its emotional response, not a reaction to their surroundings. And, their color change is limited despite what their background might be. That's the old wives' tale.