In the arms race that has been developing for countless eons in the depths of the ocean, camouflage is one of the best strategies, with the goal of making yourself as invisible as possible to predators.
There is a difference between the different layers of ocean depth. This difference can easily be measured by how much light manages to penetrate it. This difference causes a huge change in the hunting strategies of the various predators. In depths of 600-1000 meters, the sunlight is barely present. The little light that gets through is enough to expose the shadowy figures of colorful creatures.
The predators of these depths dive down and wait for prey to pass over the bright background above them, so they can easily identify it.
When you go down further than 1000 meters, the red wavelength of light actually doesn't penetrate the waters anymore, and so red and dark organisms are practically invisible. At this depth, most predators use their own light (what is also called bio-luminescence) to hunt. This ability attracts curious fish in its direction, so the predator can just wait and let them come to it.
In such cases, the best a fish could hope for is to be red or dark, a color that swallows the specific light this phenomena creates. But for those creatures living at medium depths, life is challenging. They must deal not only with the predators who are hunting by instinct, as well as those hunting by bio-luminescence. If they are transparent then they are exposed to the predators above them, but if they are dark colored they are exposed to the predators below them.
The octopus and the squid, who live in these depths, have developed a unique tactic for survival. Their default is a transparent body, that leaves only their eyes and intestines visible. In this condition, the rays of light pass through them without making shadows that could get them caught.
And as they dive, their camouflage works in such a way, that the moment a blue light is shining on them, their bodies immediately becomes either red or black, so they do not return the light.
The sheer speed of that effect can be seen in the video above, as well as some fascinating information about this natural phenomena. The moment the blue light (similar to bio-illumination of predators) the squid immediately changes it's color. The moment the light is removed it reverts to transparent form.
Sarah Zilinski, a researcher from Duke University, has made several experiments about this issue with patients. She found that the rapid color change is caused by the contraction of muscles which streths cells that contain pigments.