PHYSICS Several different optical illusions provide the Sun and the Moon with apparently varying colours over time. But the most crucial point in answering your question is that the Sun generates light, whereas the Moon only reflects it.
Sunlight is made