I had a veiled chameleon for a roommate for several years until he passed away. That species of chameleon changed their color only for mood and temperature not for camouflage. There may well be other species that can change color for camouflage but I’m not aware of them.
A chameleon changes colors to indicate mood and not as camouflage. I used to have one as a roommate and while he didn't say much I always knew where I stood with him.