Presumably, a combination of natural variation and natural/sexual selection - say chameleons' colors vary to a degree within a locale (which is true). Over time, reddish chameleons with white markings become more prevalant around Tamatave, blue chameleons on Nosy Be, pink Ankaramies, multicolored Ambilobes... female preference likely plays a role. (A mutation favoring larger areas of or more consistant blue occurs on Nosy Be, the females like it so this male has more offspring, passes on more of his genes, his offspring with blue-favoring ladies increase the proportion of blue or blue-favoring chameleons in the population, until by the time a gene leading to more pink or yellow pops up, pretty much everyone on Nosy Be prefers blue, and the pink genes don't persist in the population.