How is a stars color different based on the temperature?
Stars, like other objects emit light based on their temperature. For certain types of objects, called blackbody, or Planckian radiators, you can compute the spectral energy distribution (and therefore the color) of their emission based only on temperature. As these objects heat up, they are first dull red, then orange, then yellow, then white, and eventually blue. There is an equation known as Planck’s equation that allows computation of the spectral power distribution as a function of absolute temperature (K). That equation is what let’s us know that a blackbody at 10,000K will be bluish and one at 3000K will be yellowish. Since stars are very nearly blackbody radiators, this scale, known as color temperature, allows estimation of the star’s surface temperature based on its color. I hope this helps. This page This page has a little more explanation that might help get you started in exploring this topic more.