When you think of a color-shifting animal, your thoughts may immediately fly to the chameleon. But chromatic manipulation isn’t just the purview of little lizards -- squids and octopuses do it, too.

Now scientists are unraveling the secrets behind animals’ color-changing properties. Understanding how the animal kingdom changes its stripes (or spots) could eventually lead to a range of synthetic applications, from color-changing clothes to more efficient fiber optics.

Contrary to cartoons, the chameleon typically changes color to display his or her mood, not to blend in. Their skin contains layers of special cells called chromatophores, which contain different kinds of pigments in varying colors. The pigments are locked up in tiny sacs called vesicles, so normally their colors don’t show up.

“But when a signal comes in from the nervous system or from the blood stream, the granules or vesicles can discharge, allowing the color to spread out across the cell, and this alters the colour of the cell,” the Naked Scientists podcast explains. “It’s rather like giving the cell a coat of paint.”

Activating multiple layers of chromatophores allows the reptile to “mix” its skin color like paint. So, switching on the cells with red and yellow pigments inside will add up to an orange chameleon.

Cephalopods -- squids, octopuses, cuttlefish, and the like -- change their color for a myriad of reasons. Some use their abilities to blend in the background and hide from predators. Others change colors to send a message. Certain cuttlefishes, for instance, will turn bright red as a warning to stay away, but they also adopt a zebra-striped pattern to attract a mate.

The secret to a cephalopod’s color-changing abilities, like the chameleon’s, also lies with chromatophores. But the squid or octopus uses its chromatophores in a slightly different way. In cephalopods, the chromatophore is surrounded by nerve and muscle cells. A squid or octopus can use muscle control to change the shape or size of the pigment-containing sac inside the chromatophore, which changes how the reflective pigment proteins reflect light.

In January, a trio of scientists from the University of California, Santa Barbara published a paper in the Proceedings of the National Academy of Sciences investigating one of the special cells in a squid’s skin that create a shimmery color. These cells, called iridocytes, aren’t smooth microscopic bubbles; they’re filled with deep folds and pleats that extend far into the cell. These grooves create layers within the cell called lamellae.

The researchers found that a squid can “tune” its iridescence by altering the thickness of these lamellae, which change the wavelength of light reflected by the special proteins in the groove. The process starts with a neurotransmitter called acetylcholine that creates a cascade of signals that condenses the proteins in the lamellae and can also expel or draw in water into the iridocyte, thus making the lamellae closer or farther apart.

Studying how squids make rapid color changes could have implications beyond marine biology, according to senior researcher Daniel Morse.

“In telecommunications we're moving to more rapid communication carried by light," Morse said in a statement Thursday. "We already use optical cables and photonic switches in some of our telecommunications devices… can we learn from these novel biophotonic mechanisms that have evolved over millions of years of natural selection new approaches to making tunable and switchable photonic materials to more efficiently encode, transmit and decode information via light?"

Some researchers and artists are already trying to mimic the color-changing abilities of chameleons and squids. Karma Chameleon, a group at Concordia University in Canada, is working on “smart” electric fibers that can be woven into garments that change color. And, no batteries required: their proposed design would draw eat energy from the wearer’s body.

“We won’t see such garments in stores for another 20 or 30 years, but the practical and creative possibilities are exciting,” Concordia researcher Joanna Berzowska said in a statement in April.