The color of the sky during daylight and at night is primarily due to the scattering of sunlight and the absence of sunlight, respectively.
**Blue Sky During Daylight:**
During the day, the sky appears blue because of a phenomenon called Rayleigh scattering. The Earth's atmosphere is composed of molecules and tiny particles. When sunlight, which is made up of different colors (wavelengths), passes through the atmosphere, shorter wavelengths, like blue and violet, are scattered in all directions more than longer wavelengths (red and yellow).
Blue light is scattered more than other colors because it has shorter wavelengths. This scattering causes blue light to be redirected in various directions, and it becomes more prevalent in our line of sight, giving the sky its blue appearance. This is why the sky can appear blue on a clear day.
**Pitch-Black Sky at Night:**
At night, when the Sun is below the horizon, the sky appears black because there is no direct sunlight to illuminate the atmosphere. However, the darkness of the night sky is not absolute. Even at night, various celestial objects, such as stars, planets, and galaxies, emit their own light, and this light can be observed when there is minimal interference from artificial lighting and city pollution.
The sky is black at night because our line of sight is not filled with scattered sunlight, and instead, we see the distant stars and celestial objects that emit their own light. The absence of direct sunlight allows us to see the vast expanse of the universe beyond Earth's atmosphere.
It's worth noting that the sky's appearance can change during twilight periods, both at dawn and dusk when the Sun is below the horizon but still scatters some light in the sky, creating different colors and gradients, including shades of blue and red.