If a star moves relative to an observer, the light that is emitted by that star is either compressed, or stretched out. The change in wavelength is perceived as a change in color. Longer wavelengths (if the star is receding) result in the light taking on a redder tone. Shorter wavelengths (if the star is approaching) result in a bluer tone.

Move the mouse cursor around to move the star. Start slowly, and then increase the speed. Click the left mouse button to clear the screen.