By me
One of the greatest questions I've ever found myself asking was, plainly:
octopus use changing their pupil shape to occlude the middle, using chromatic aberrations and diffraction in the thin radial slit not occluded to interpret color information!
Many cephalopods have skin covered in chromatophores, special sacs of pigment that may inflate/deflate depending on nervous signal from the animal, depicting a combination of colors based on which sacs are inflated. They function a lot like RGB displays!
wowowow a description of the optical phenomena potentially responsible behind diffraction-based color vision
The second leading theory is that cephalopods just have something in their skin (specfically in chromatophores) that can see color which is just bananas (I don't believe in this one)
There's evidence that points towards cephalopods not being able to distinguish color at all, rather intuiting that an object's shape corresponds to a color they should turn into based on lots of evolution! This is compelling, but I tend to believe they understand what color they are, many of these other papers demonstrate that!
wowowowowow this paper measured the spectra given off by backgrounds in octopus habitats and the octopus when camouflaging to that background. Comparing those measurements shows a significant difference between the spectra of the background and octopus, so their camouflage is not perfect (they're made of different stuff than their backgrounds!). The interesting conclusion of this article is that octopus
I haven't read this yet, but I will get to it!