The sky appears blue when the scattering of light takes place through the atmosphere.The blue color of the sky is due to scattering of light from the atmosphere.As there is no atmosphere in space and hence light does not scatter into its constituent colors that is why the sky appears dark instead of blue to an astronaut in space.