Even that isn't quite correct. There is a variation in speed due to density, specifically the electron density. That would be affected by temperature and pressure, for example. Generally speaking, a higher density gives a higher index of refraction and so a smaller phase velocity.<quoted text>
Monochromatic light (light of a given frequency) has a constant speed, through water... right?
So, for 'ordinary' materials, the index of refraction depends on the frequency, the electron density of the material, and the location of absorption lines in the spectrum of the material.