The actual color of the sun is white. If you look from the space it would white.
But what about when you look at the sky and the sun looks yellow.
The reason behind this is the Earth’s atmosphere. When sun rays reach Earth’s atmosphere it scatters into higher wavelength colors. Among those left high wavelengths is a yellow color. Therefore the sun appears yellow when we see it.
It works the same way in a prism. If you put a prism in sunlight, you will see it breaks the sunlight into seven colors: red, orange, yellow, green, blue, violet and indigo.