I realise that the speed of light varies depending on the material it is travelling through. You are right.
Light travels at different speeds in different materials.
It travels at 300,000 kilometres per second in a vacuum, at a slightly lower speed in air, and at about three-fourths that speeds in water. In a diamond, light travels at about 40 percent its speed in a vacuum. When light is bent twice, as in a prism, the separation of the different colours of light is quite noticeable. This separation of light into colours arranged according to the frequency to their frequency is called dispersion .