The color of a star depending on its surface temperature
It's easy to see that stars come in different colors—some are white, others are yellow, still others are red, and so on.
Depending on their temperature, the wavelengths of light emitted by stars will differ. The human eye perceives these differences as shades of color within the classic spectrum—from red to violet. In other words, we see stars of different colors because they are heated to different temperatures.
For example, Sirius and Vega are white, Capella is yellow, and Betelgeuse and Antares are red. Stars of different colors have different spectra and different temperatures. Just like a piece of iron being heated, white stars are hotter, while red stars are cooler.
It has been established that blue stars are the hottest, followed by white stars. Their surface temperatures range from 10,000 to 30,000°C, but sometimes even hotter stars are found, with temperatures reaching up to 100,000°C. Yellow stars are cooler: their surface temperatures are around 6,000°C. Red stars are the least hot: their surface temperatures are only 3,000°C, and sometimes even 2,000°C or less. Deep inside stars, just as deep inside the Sun, temperatures reach many millions of degrees.