The color of an object is depends upon its temperature as predicted by the Stefan-Boltzmann law.  This law describes the "ideal" blackbody radiation given off by any object above absolute zero.  Every objects emits blackbody radiation although you do not normally notice it because our eyes are only sensitive to a very small portion of the electromagnetic spectrum.  An object must be quite hot for it to emit visible light. For example, the heating element on a stove glows "red hot." The Stefan-Boltzmann law allows us  to determine the temperature by measuring the color spectrum given off by the heating element. Our Sun is an another example of a "real" blackbody radiator. Its spectrum isn't as smooth as the "ideal" ( it is pitted and bumpy due to real-world conditions including, but not limited to, absorption of the radiation en route to the earth) but it is close enough.   It fact, measuring color is the primary means astronomers have of determining the temperatures of distant stars.

Temperature of the BlackBody applet can be set in two ways. The first is to set the actual temperature typing in a new value in the text field below.  The applet will then show you the spectrum and the apparent color of the object. The second way is to move the peak wavelength by click-dragging on the graph itself. Temperature can be related to peak wavelength according to Wien's Law (T = 2.9E-3/lambda_max)--which can lead to temperatures much in excess of 10,000 Kelvin.  Note the change is scale on the y axis. The total energy radiated by a black body increases dramatically with temperature although we autoscale the graph to highlight the change in color.

A simulation of the visible spectrum is displayed under the curve, corresponding to 400 (blue), 500 (green), and 600 (red) values. The colored circles on the left represent the percent of each color present and a simulation of the total color of the object.

Change the temperature