How do organisms that camouflage tell their body which colour to change to?


I just saw a video of an octopus changing its colour to match the rocks near him. How is this information processed (I’m assuming that octopus saw the colour of the rock and then had its body change its colour)? Can they recognize and identify colours?

In: Biology

One of the theories is that octopus have optical sensors all over their skin too see what the surrounding area looks like

To add more context to Arthur2’s answer, we still don’t fully understand how cephalopod camouflage works. The working theory is they use chromatophores (special cells that contain pigment (color)) and the ability to change the color depending on the muscle tensions.

The documentary Life in Colour with David Attenborough is very interesting and mentions camouflage. They put a cuttlefish in tank with black & white tiles to see what they do when their environment is not natural. The little guy tried his best, it’s adorable.

Octopi and such have photoreceptors in their chromatophores similar to those found in the cone cells in the eye, basically those cells have some limited ability to “see” the surrounding environment and are able to change color to march it, this information being transmitted via the nervous system when, for example, the octopis front facing side changes color to match what is in proximity to the rear

and what chameleons do? is it the same case as the octopi?