If you move closer to a beam of light emitted from an object, the speed of light remains constant for all observers in a vacuum, according to the theory of special relativity. This fundamental principle is known as the constancy of the speed of light.
However, as you move closer to the source of the light, the frequency of the light waves, which determines its color, does not change. What does change is the number of wave crests passing a given point per unit time, which is known as the wave's frequency. As you move closer to the source, the frequency of the light waves remains the same, but you perceive more wave crests passing by per unit time. This increased frequency of wave crests is what causes the light to appear bluer or shift towards the higher end of the electromagnetic spectrum, known as a blue shift.
Conversely, if you were moving away from the source of light, you would experience a red shift. The frequency of the light waves would remain the same, but you would perceive fewer wave crests passing by per unit time, causing the light to appear redder or shift towards the lower end of the electromagnetic spectrum.
It's important to note that this phenomenon is a result of the relative motion between the observer and the source of light, as described by the Doppler effect. The speed of light in a vacuum, however, remains constant for all observers, regardless of their motion relative to the source of light.