A blackbody is an idealized object that absorbs all radiation that hits it and re-emits it purely as a function of its temperature. The hotter it is, the more energy it radiates at every wavelength, and the peak of the spectrum shifts to shorter wavelengths — Wien's law.
Blackbody emission and the temperature dependenceWien's law λmax · T = 2.898 × 10⁻³ m·K
Stefan-Boltzmann P = σ · T⁴ (total power)
Planck spectrum B(λ,T) = (2hc²/λ⁵) / (e^(hc/λkT) − 1)
Why the colour changes
At 3,000 K the peak sits in the infrared and the object glows dull red; at 5,800 K (like the Sun's surface) the peak is in the visible band. Higher temperature means bluer peak — cooler means redder.