system
Given the following post, respond as if you're commenting on Reddit:
human
Why does the color of fire change at different intensities of heat? 

Layman here. It also could be cool if someone could maybe relate this to why stars burn at different colors depending on heat.
gpt
Run of the mill everyday fire and the stuff going on in stars are completely different, so they don't have the same answer.  

I can answer for fire.  What determines the color of a fire's flame is what chemicals are present in the hot gasses created during combustion.  So take a bunson burner for example, or your gas stove (same thing) these are burning natural gas.  If oxygen is in excess - meaning gas flow is low compared to air flow you will get a nice blue flame.  This flame is hotter than a yellow falme, but being hotter isn't really why the flame is blue and not yellow, it is because the excess of oxygen allows for very complete combustion which makes a hotter flame, also complete combustion gives one specific reaction chain for burning so you get one set of chemical products combusting which give off blue light when they are hot, excited and reacting.  

Now if you lower the oxygen vs the gas you will get incomplete combustion and yellow flames.  What is happening here is there are more hydrocarbon compounds in the gasses exiting the reaction and those do not glow blue when they are hot, excited and reacting.  So same story for burning a piece of wood, you will have non complete combustion and so it kicks off a bunch of hydrocarbons from the burning reaction which glow yellow or orange or red, and you will also see a bunch of smoke and soot created. 

This also happens with metals, in fireworks for instance.  When metals burn the chemicals produced by the combustion glow different colors because each chemical has electrons in different configurations and energy levels and when they are brnuing they jump around and react and a byproduct of those electrons moving is that they emit light.  Light is a different color for different moves.