Chameleons change color to match their background
The old claim turned out to be wrong and was rejected by evidence.
TaughtA chameleon changes color to blend in with whatever it is sitting on.
NowColor change is mostly communication and temperature regulation, signaling mood, dominance, and readiness to mate. Camouflage is a secondary use at best.
What actually happened
If camouflage were the purpose, chameleons would turn the color of what they are standing on. They mostly do not. A male confronting a rival flares into vivid display colors that make him dramatically more visible, which is the opposite of hiding. Chameleons also darken to absorb heat when cold and lighten when hot.
The mechanism itself was misunderstood until recently too. Rather than simply moving pigment around, panther chameleons actively tune a lattice of nanocrystals in their skin cells, changing the spacing to shift which wavelengths are reflected. That was published by Michel Milinkovitch's group in Nature Communications in 2015. So the animal is closer to a tunable photonic crystal than to a paint mixer, and it is using it to talk rather than to disappear.
Newsletter
Get new weekly revisions
Sources
Who was taught this
Still standard through 2015, so anyone who finished school between 1950 and 2008 learned the earlier version.