Hotter stars emit more energy at shorter wavelengths, appearing blue or white in color. These stars are typically younger and are classified as O, B, A, and early F-type stars. The sun, for example, is a G-type star with a moderate surface temperature, emitting a yellow light.
As stars age, they cool down, and their color shifts towards the red end of the spectrum. Red giants, such as Antares, are old stars with relatively low surface temperatures and appear reddish in color. These stars are in the later stages of their evolution, having exhausted much of their hydrogen fuel.
The progression of stellar color with age can be summarized as follows:
O-Stars: Very hot, blue-white stars. Young and massive.
B-Stars: Hot, blue-white stars. Also young and massive.
A-Stars: Hot, white stars. Less massive than O and B stars.
F-Stars: Hot, white-yellow stars. The Sun is an F-star.
G-Stars: Yellow stars like our Sun. Middle-aged stars.
K-Stars: Orange stars. Cooler and older than G stars.
M-Stars: Red stars. Small, cool, and very old stars.
Therefore, the age of a star is closely tied to its color, with younger stars generally being hotter and appearing blue or white, while older stars are cooler and appear yellow, orange, or red.