I've never read anything about it, but if I were to bet some money it would be that they owe their colors to female sexual selection, as in pretty much every other species where the males are flashy and the females are drab. They have two pressures on their coloration: camouflage against predators and female sexual preference, so they always have to balance those two pressures. In species where predators are few, males are free to indulge females more and thus have flashier colors (not just because the ladies like them but because you want to stand out from your background, to get their attention faster.)
Panthers have the added benefit of being able to alter their coloration, so unlike the poor guppy fish in studies by Dr. John Endler (1980, 1983, 1986) (he put fish into 10 ponds, 2 with no predators, 4 with a strong predator, and 4 with a weak predator and let them do their thing for 14 months) the chameleons have the benefit of being able to tone down their bright colors for survival while at the same time being able to turn up the dial as soon as a female walks by. The guppies could not, so in the ponds where predation was strong the guppies had to sacrifice flashiness for practicality. Where as the males in the no or weak predation ponds had become significantly more colorful, and had developed spots/patterns which contrasted against their environment, for increased visibility for females.
As far as where each locale color palette comes from, that's harder to say. I don't think it has anything to do with the color of the water or the trees, but let's assume that they started off as green (since most continental African chameleons are green). Once they had colonized the island of Madagascar I think it was probably just a question of where color variations started to pop up. If one chameleon in one area turned out a little more teal than blue and more females found that attractive (females are attracted to "different" and "new") then that male had more offspring. Those offspring were selectively more and more teal until they were turquoise, and so on and so forth. Where as the same process probably began somewhere else with a different palette, until the different locales began taking form. For example.
Sorry for the wordiness.