Different colors of light have different wavelengths and refractive indices. Shorter wavelengths, like violet, have a higher refractive index and bend more, while longer wavelengths, like red, have a lower refractive index and bend less.