In fact, an object in any temperature will emit EM waves in many frequencies. If we plot the intensity emitted at each frequency, we have the spectrum of the radiation. We call it the black body spectrum. For warm object, the peak of the spectrum is of red color. If it is hotter, it is yellow, etc. Thus, we could tell the surface temperature of a star by its color.