The typical, bright, yellowish-orange upper part of a flame is due to the heating of unburned carbon particles.
The temperature of the fire and the material being burned are the factors that determine the color of the flame. The various colors of flames in a wood fire are due to the different substances in the flames.
The strong orange color of most wood flames results when sodium contained in the wood is heated.
The temperature of wood flames is lower than that of candle flames, which colors the wood flames orange, not yellow. If, however, some of the carbon particles in the fire are very hot, the color will be yellow. The product of the burnt carbon, when it has cooled, is black soot.
Since fire needs oxygen to burn, and since the bottom of a candle flame does not get much oxygen, it is the hottest spot in the flame and is blue in color.
The flame cools and changes color as it moves away from the source of the flame, because it is exposed to more oxygen. The temperature change causes the color of the flame to change from blue, at the hottest, lower portion of the flame, to the typical, bright, yellowish-orange or bright orange color with which most people are familiar with. Which shade of orange is seen at the upper portion of the flame, where the flame is the coolest, depends upon the material being burned.