The color is basically a function of mass and radius (or temperature, see later)
The mass-luminosity relationship states
Lstar=M3.5star in units of Lsun and Msun.
Now we find the flux E = Lstar/area
E = Lstar/4[pi]r2
From there, the total radiation given off per meter2 = the Stephan-Boltzmann constant times the themperature4 or
Tstar= {E/[sig]}1/4
now replacing E with Lstar/4[pi]r2 we see
Tstar= {Lstar/4[pi]r2[sig]}1/4.
Next, we use Wien's law to see [lamb]max=3,000,000/Tstar in nm
So, given mass and radius we can calculate the wavelength of maximum emission of the star by
[lamb]max=3,000,000 / (Lstar/4[pi]r2[sig]}1/4).
and recall that:Lstar=M3.5star
and finally we obtain :
[lamb]max=3,000,000 / (M3.5star/4[pi]r2[sig]}1/4)
where we only need mass and radius and
where:
M= mass
L=luminosity (both in unts of the sun)
[sig]= Stephan-Boltzmann constant
[lamb]max= wavelength of maximum emission in nano meters.
We find that the reddest stars are cool and big, large hot stars are blue, and small hot stars are white.
Of course, astronomers are lazy and would just look at a http://www.astro.ubc.ca/~scharein/a311/Sim/hr/HRdiagram.html
I also need to point out that there are different ways to go about finding the answer depending on what information is given.. Note that mass is the most important measurment we can get. If we know the mass or the (absolute bolometric) luminosity then we can find the radius if we know temperature and vica versa. To know the mass or luminosity we really need a spectroscopic binary or an eclipsling binary, respectivly. But our most accurate measurment of luminosity comes from mass, as it is not possiblt to know exactly how much extinction occurs. We do know stars gain about 1.9 magnitudes per 1000 parsecs distance. I say gain beacuse the lower the magnitude a star is, the brighter it is. Maybe I should say they look 1.9 magnitudes fainter.
Does that clarify things a bit? or did I just confuse you even more ?
I think this is correct, or I hope someone will at least notice and correct me. I may be missing somthing about some of this only applying to main sequence stars. This was a nice refresher, so I'm sure I'm still forgetting much right now.