Here's a breakdown:
* Spectral Class: Astronomers classify stars based on their spectral lines, which are unique patterns of light emitted by different elements in the star's atmosphere.
* Color and Temperature: The spectral class is directly related to a star's surface temperature. Hotter stars are bluer, while cooler stars are redder.
Here's a common mnemonic to remember the spectral classes from hottest to coolest:
O B A F G K M
* O: Blue, hottest
* B: Blue-white
* A: White
* F: Yellow-white
* G: Yellow (like our Sun)
* K: Orange
* M: Red, coolest
So, for example, all stars classified as G2 (like our Sun) will be yellow and have a similar temperature.