Temperatures on Earth can be measured via thermometers by contact but to measure the degree of heat in a distant celestial body, astronomers study the radiation emitted by them. With increasing temperatures, objects glow from red to yellow to blue. However, with a further increase, heat can't be measured with colours, hence, scientists study frequencies of ultraviolet, X-ray, gamma radiations.