The angle of deviation produced by a prism depends on the refractive index of the material of prism. The refractive index of material of prism is different for different colours of light because the speed of different colours is different inside the prism. Thus, the light of different colours is deviated through different angles, by a prism.