As wavelength of light decreases, the velocity of light decreases. Now, we know, absolute refractive index of a medium is equal to the (speed of light in air)/(speed of light in that medium), therefore if the velocity of light changes, the refractive index of the medium (for that wavelength of light) also changes.
Example: it's due to this difference in velocities that dispersion of sunlight (to form rainbow) takes place. While rainbow is formed, the different colors (with different wavelengths) bend at different angles, but as all colors of light pass through same medium, thus, refractive index of medium does depend on the wavelengths