The common portrayal of the Sun as yellow, orange, or red is indeed a widespread misconception. In truth, the Sun, a massive star at the center of our solar system, produces light that is almost a perfect representation of what scientists call "white light." This is due to the Sun emitting light across almost all wavelengths visible to the human eye, from violet to red, along with some ultraviolet and infrared emissions that are outside the visible spectrum.
When sunlight reaches Earth and interacts with the atmosphere, it undergoes scattering. This process affects colors with shorter wavelengths, like blue and violet, more profoundly than those with longer wavelengths such as red and yellow. This scattered blue light is what gives Earth’s sky its characteristic blue color during the day. During sunrise and sunset, the Sun’s light has to pass through more of the Earth's atmosphere, which disperses the shorter wavelength colors and allows the longer wavelengths (reds and oranges) to dominate, thus giving the Sun its reddish appearance at these times.
Moreover, the perception of the Sun’s color can be influenced by factors such as atmospheric conditions, including particle pollution and natural events like volcanic eruptions, which can intensify scattering and influence color perceptions further. However, if observed from space or a high altitude without atmospheric interference, the Sun would appear as it truly is: a bright, white star.
This white coloration of sunlight is because the Sun burns at a temperature that is conducive to emitting a broad range of visible light along with other forms of radiation. The temperature of the Sun’s surface is about 5,500 degrees Celsius (about 9,932 degrees Fahrenheit), and such conditions favor the generation of a broad spectrum of light wavelengths. This broad spectrum leads to the emission of all colors, which combine to produce white light.
Understanding the true color of the Sun helps in several branches of science including astronomy and climatology, and can correct common misconceptions that persist in popular culture. It is a testament to how our immediate environment - in this case, Earth's atmosphere - can alter our perception of natural phenomena.