We owe seeing anything at all to the sun. Even though we usually do not consciously see this, sunlight has a visible spectrum between—and not including—ultraviolet and infrared. Rainbows show us this visible spectrum with colors ranging from short-wavelength violet and blue over green, yellow, and orange to red with longer wavelengths.
When sunlight enters the earth’s atmosphere, it is scattered by very small molecules present in the air. This scattering is stronger for light with a shorter wavelength, causing a greater proportion of short-wavelength colors like blue to be scattered than other colors with a longer wavelength. Additionally, the human eye responds most to the colors blue, green, and red. Combining this with the scattering effect explains why the sky appears blue to us during the day. And remember, blue skies are ideal for sky gazing.