White light is composed of of a continuous spectrum of colours. You will remember Richard Of York Gave Battle In Vain. A useful way to learn Newton’s seven colours in order. You could argue that as it is a continous spectrum there are many more colours than seven. Newton chose seven as apparently he liked the idea of linking the colours to the number of notes in a major scale. Seven is also linked to the idea of perfection.
Red light is made of the longest wavelength and Violet light the shortest. When light interacts with matter it can be scattered, reflected, refracted or diffracted.
The molecules in air are predominantly oxygen and nitrogen. Nitrogen and oxygen molecules are particularly good at scattering blue light in many directions. This is because the wavelength of blue light is at the shorter end of the spectrum and this is the wavelength that gets scattered the most by these molecules.
The physicists in the room are asking but why don’t we see the sky as violet as violet has a shorter wavelength than blue?
Good question. There are two main reasons:
The first is that our eyes are more sensitive to the colour blue than violet so if we see a lot of both our eyes would favour blue.
The second is that the our sun with a surface temperature of around 6000 K is fairly cool compared to other bigger stars so doesn’t emit as much violet light as a hotter higher mass star would.