A fun detail is that Newton figured this out, but managed to use two materials of essentially the same dispersion, so his experiment failed and he gave up. But he had the right idea.