Did you ever ask yourself why the sun is bright yellow during the day and why the moon glows white at night? Well, there is fascinating science behind it all—how light, the Earth's atmosphere, and the eyes all collaborate to give us the beautiful colors we observe in the sky. Let us start.
To our surprise, the Sun also emits a white light, containing all the colors of the color spectrum. On traveling through the Earth's atmosphere, blue and white's shorter wavelengths appear to be scattered more. This scattering is known as Rayleigh scattering, and it causes the sun to appear yellow or sometimes orangish. The yellow sun which we see is because of filtering through the atmosphere.
Unlike the sun, the moon does not emit its own light. It reflects the sunlight off its surface. Volcanic dark rock makes up the surface of the moon, and this rock absorbs most of the light but reflects very little. Even at full moon, its reflected light is approximately 400,000 times less intense compared to the sunlight. Isn't that awesome? Its dim brightness is the reason we are able to see its color from Earth.
We all possess two types of photoreceptors, i.e., cones and rods. Cones detect color but need bright light to function. Rods work in darkness but detect only shades of gray. Our rods work predominantly at night since moonlight is very feeble. Because of this effect, we can detect the reflected moonlight as gray or white but not as any other color.
Compared to the top position, the light of the moon has to travel through a denser Earth's atmosphere when it is lower on the horizon. Longer wavelengths such as red or orange dominate since shorter wavelengths such as blue are dispersed by the surroundings. That is why the Moon sometimes turns yellow, orange, or even red when moonrise or moonset is occurring, creating an amazing and beautiful sight in the evening sky.
The colors that we see in the Sun and the Moon vary based on various factors. The Sunlight is scattered by the Earth's atmosphere and is thus yellow. The dark, reflective surface of the Moon does not project much light towards the Earth. Finally, the way the eyes respond to color and light in different conditions decides what we perceive. All these put together produce the gorgeous and varying colors that we perceive in our sky during the day and night.