Here's why:
* Color and Temperature: The color of a star is directly related to its surface temperature. Hotter stars emit more blue light, while cooler stars emit more red light.
* Blackbody Radiation: Stars, like all objects, emit electromagnetic radiation. This radiation follows a pattern known as blackbody radiation, where the peak wavelength of the emitted light depends on the temperature. Hotter objects emit peak wavelengths that are shifted towards the blue end of the spectrum.
So, the bluer a star appears, the hotter it is.