It’s the doppler effect, but with light instead of sound, and for the same reason.
Thing emits sound/light waves at a constant rate: sound/light waves hit you at a constant rate.
Thing continues to emit the same sound/light at the same rate, but starts to move toward you: sound/light waves hit you at a faster rate, causing the sound/light to turn higher-pitched/bluer.
Thing continues to emit the same sound/light at the same rate, but starts to move away from you: sound/light waves hit you at a slower rate, causing the sound/light to turn lower-pitched/redder.
It’s the doppler effect, but with light instead of sound, and for the same reason.
Thing emits sound/light waves at a constant rate: sound/light waves hit you at a constant rate.
Thing continues to emit the same sound/light at the same rate, but starts to move toward you: sound/light waves hit you at a faster rate, causing the sound/light to turn higher-pitched/bluer.
Thing continues to emit the same sound/light at the same rate, but starts to move away from you: sound/light waves hit you at a slower rate, causing the sound/light to turn lower-pitched/redder.