|Don't sue me, Fox, I guess?|
Now, on to the question itself. The answer is that blue giants are the hottest. I suspect this is supposed to be something of a trick question. In everyday life we associate blue with cold and red with hot, but the exact opposite relation is true for hot, dense objects; red is relatively cool, blue hot. Why this discrepancy exists has to do with what color is really all about.
In general, there are three sources for the colors of objects: thermal radiation, reflection/absorption, and atomic spectra. That first one is the reason why blue stars are the hottest. Or rather, it's why the hottest stars are blue. Anything with a temperature emits a spectrum of radiation based on that temperature.
|By Darth Kule (Own work) [Public domain], via Wikimedia Commons|
For humans and most other room-temperature objects, the peak wavelength is in the infrared, which our eyes are not sensitive to. Everyday objects do emit some visible light, but as you can see from the Planck spectrum, the intensity drops off very quickly to the left of the peak, so our thermal emissions are essentially invisible to us.
Where we are most likely to encounter visible thermal radiation, not counting the sun, is the stovetop. Heat a piece of metal up to a few hundred degrees and it will start to glow red. Since it is difficult for us to achieve higher temperatures in everyday situations, this is probably where our sense of what hot looks like comes from. Compared to the most massive stars, a heating element is downright chilly, but it's much hotter than we are, so red = hot. Other Earthly examples include hot coals and lava (and some of the color of fire, with the rest coming from emission lines).
As far as why we associate blue with cold, the most likely explanation is that water and ice are blue-tinted. Another possibility is that blue is simply the opposite of red in our brain, but for the purpose of making this blog post longer, let's go with the first explanation.
The ocean is not blue because the sky is (nor is the sky blue because the ocean is). The ocean is blue because water preferentially absorbs red light and reflects blue light. The reason water in a cup is clear is because water transmits almost all light that touches it, but the light it does not transmit is either absorbed or reflected. So with small quantities of water, there is not enough reflection to notice. For an ocean, it's unavoidable.
Reflection and absorption account for nearly all the color we ordinarily see. The details of why objects reflect or absorb particular wavelengths turn out to be pretty complicated and not reducible to a clever function or graph. However, there are some relatively simple examples that demonstrate the importance of wavelength when it comes to the behavior of light.
The most obvious example is the blue sky. The sky is blue due to a process known as Rayleigh scattering. Rayleigh scattering occurs when the wavelength of light is significantly bigger than the particles that light is striking. In that case, the light is either transmitted or scattered, and the probability of scattering is inversely proportional to the 4th power of the wavelength. This means light at the blue end of the spectrum can be scattered up to 9 times as much as light at the red end (700 nm/400 nm)4.
When light is scattered, it bounces off the particle it strikes in a random direction. Eventually, this light will scatter such that it gets to your eye, but by then it's not likely to look as if it was coming from the source. So when we look at the sky, we see the sun no matter what direction we look. The difference is that the red and yellow light of the sun comes directly to us while the blue light bounces around a bit first.
When particle size gets much bigger, as happens for the complex molecules that make up people, shirts, and paint, the size and shape of the molecule plays a much more important and complicated role in which wavelengths get absorbed, transmitted, or scattered.
The final source of color is atomic spectra, which we observe as either emission or absorption lines. Each element on the periodic table is composed of electrons in orbit of a nucleus. The orbits an electron is allowed to have are prescribed by the number of protons, neutrons, and electrons present and the rules of quantum mechanics.
To occupy a particular orbit, an electron must possess a particular energy. If that electron moves from a high energy orbit to a low energy orbit, conservation of energy says it must release energy equal to the difference in energy levels between the two orbits to account for the transition. This energy is released in the form of a photon--light. The wavelength of that photon, and consequently the color, is inversely proportional to its energy. So big jumps produce energetic, blue photons, whereas small jumps produce red photons. (Gamma ray photons and radio wave photons and any other kind of photon are also possible depending on the energy levels involved.)
This process works in reverse, too. If light with enough energy to effect a jump hits an electron, then the electron absorbs the light and goes from a low energy to a high energy orbit.
Because these transitions only occur at specific wavelengths, we see these as emission and absorption lines rather than the spread out thermal spectra that hot objects produce. On Earth, the most common example of an emission line is a neon sign. An electric current passes through a gas, such as neon, exciting the electrons in the gas. When the electrons come down from their excited energy levels, they emit photons of a particular wavelength, giving off their characteristic orange-red glow.
There's not a great example of absorption lines on Earth that I'm aware of, but a particularly stunning example is the sun. While the sun has a nearly perfect blackbody spectrum, if you spread out its light with a spectrograph, you will notice gaps of color. These gaps are absorption lines and represent all the elements in the sun's outer photosphere (as well as some in our atmosphere, depending on where you take the light from), which is colder than the rest of the sun and absorbs light that passes through on its way to us.
messy, smeared out way and atomic spectra in a precise, limited way. And when light is absorbed or reflected by a surface, the ultimate reason is that quantum mechanical electronic energy levels are being messed around with, just like in atomic spectra. The difference is the former is much harder to calculate via quantum mechanics, so instead we label it with a simple refractive index that varies based on wavelength and is derived from observation.
Anywho, that's all for now. And I didn't even touch on how the physics of color interacts with the biology of sight, which is also a fascinating subject. Next time, quantum physics. Unless I detour into my calendar once again.