The classification of stars by color is based on their effective temperature, which is a measure of the surface temperature of the star. Although the Sun's light appears white to our eyes, it is still classified as a yellow star because its effective temperature falls within the range of temperatures associated with yellow stars.
The color of a star is determined by its surface temperature, and stars emit light across a broad range of wavelengths. The visible spectrum, which is the range of wavelengths our eyes can detect, includes colors such as red, orange, yellow, green, blue, and violet. When we see a star, we are primarily perceiving the wavelengths of light emitted from its surface.
The Sun has an effective temperature of around 5,500 degrees Celsius (9,932 degrees Fahrenheit), which corresponds to a peak intensity of light in the greenish-yellow part of the spectrum. This peak intensity gives the Sun a yellowish appearance when viewed from Earth.
However, it's important to note that the color classification of stars is somewhat subjective and can vary depending on the system used. Different classification systems and models may assign slightly different colors to the same star, as it depends on the specific temperature range associated with each color category.
So while the light from the Sun may appear white overall, its classification as a yellow star is based on its effective temperature falling within the range associated with yellow stars in the commonly used star classification systems.