system
Given the following post, respond as if you're commenting on Reddit:
human
ELI5: What exactly makes the sky different colors at different times of the day?

I've always heard about "scattering" and that blue light is "scattered more," but what does that really mean? Why can the sky become red/orange as well then?
gpt
On its own, the Sun is almost perfectly white. Its light covers a broad spectrum of colours ordered by wavelength, from infrared (long wavelength) through reds, yellows, greens (the brightest part), blues and violets and tapering off in ultraviolet (short wavelength).

When light passes through something transparent and colourless, it undergoes what is known as *Rayleigh scattering,* which means that each photon of light has a certain probability to veer off in a different direction rather than moving in a straight line. For interesting quantum reasons, short-wavelength light scatters much more than long-wavelength light. (Of course, the amount of scattering  also depends on how deep and dense the transparent material is.) To illustrate this, imagine a bunch of red photons and equally many blue photons in a beam. It moves through a material, and every now and then, a photon "hits" an atom and jolts off in a different direction, like a subatomic billiard ball. The wavelength of the red photons is about 2 times as long as that of the blue ones, so due to the aforementioned quantum stuff, it turns out that the blue photons are 8 times as likely to scatter. Therefore, when half the blue photons have scattered, 91% (the 8th root of ½) of the red ones are still in the beam. Much later, when half the red photons have scattered, only 0.4% (½ to the power of 8) of the blue ones remain.

When the Sun is high in the sky, it passes through 100 km or so of air, which is enough to scatter blue, violet and ultraviolet light many times over, so that it is spread out evenly throughout the air. On the other hand, shorter-wavelength light hardly has time to scatter at all. Therefore, the reds and greens and yellows come straight from the Sun (they mix to form a slightly yellowish white light, but the Sun is perceived to be much more yellow than it actually is for interesting psychological reasons), while the air is filled with blues and violets all over. Sunlight contains much more blue than violet, so even though violet (and ultraviolet) scatters even more, it is washed out by the blue.

When the Sun is rising or setting, its light hits the atmosphere edge-on, so it must pass through much more than 100 km of air. The short-wavelength light is scattered so much that very little of it reaches your eyes -- it is absorbed, or veers off into space, or hits the ground in some other part of the world. Only long-wavelength light -- reds and oranges -- remains, and is scattered by a moderate amount, enough to spread out in the sky but not enough to disappear. Under the right conditions, further scattering on clouds or dust in the air can make the colours even more vivid.