Why is sky red/yellow in the evening and blue in the day?

At dawn and dusk, large amount of blue and violet light(shorter wavelength) has been scattered so, the light that is recieved by an observer is mostly of a longer wavelength and therefore appears to be red.

Because of refraction of light/