Here's why:
* The Sun is actually white: The Sun emits all colors of light, and when combined, they appear white.
* Yellow perception: From Earth, the Sun often appears yellowish due to the scattering of blue light by the atmosphere. This effect is similar to how the sky appears blue during the day.
So, while we often refer to the Sun as yellow, it's more accurate to say it's a white star.