The blue color of the sky on Earth is due to the Rayleigh scattering of sunlight by molecules in the atmosphere, which scatters shorter blue wavelengths more effectively than longer red wavelengths. In the vacuum of space, there are no significant particles to scatter sunlight, so the sky appears dark.