The color of the sky appears to be light blue from Earth's surface due to a phenomenon called Rayleigh scattering. The Earth's atmosphere consists of tiny molecules, such as nitrogen and oxygen, that scatter sunlight in all directions. When sunlight passes through the atmosphere, it interacts with these molecules and gets scattered.
The blue light in the visible spectrum has shorter wavelengths and is scattered more efficiently by the atmospheric molecules compared to other colors. As a result, when sunlight passes through the atmosphere, it scatters more blue light in all directions, making the sky appear blue to an observer on the ground.
From space, however, the sky appears black because there is no atmosphere to scatter sunlight in all directions. In the absence of an atmosphere, sunlight travels through space in straight lines and does not get scattered significantly. This lack of scattering results in a dark background, making the sky appear black when viewed from space.
It's worth noting that the color of the sky can vary depending on various factors such as atmospheric conditions, the presence of pollutants or particles in the air, and the angle of the sunlight. At sunrise or sunset, for example, the sky can take on warm hues of red, orange, or pink due to a different scattering phenomenon known as Mie scattering, which is caused by larger particles or aerosols in the atmosphere.