If you immerse RGB (red-green-blue) light sources in the pool of water, then will the colors of light change? The detector senses the photon energy, whereas we uderstood from the basic laws of classical electromagnetism that the photon energy may remain invariant propagating through a refractive medium. Hence, if frequency dictates the color of light, what happens for the corresponding shortened wavelength during the the propagation. Conversely, the light frequency and the photon energy changes due to Doppler effect facing red or blue spectral shift !