Fuel Composition...
The nature of the fuel and its chemical composition can also affect the color of the flame. This is because, when excited, every element can emit light; the wavelength, and hence the color, of the emitted light is characteristic of each element.
In the case of the fuels mentioned above, they are made mainly of hydrocarbons, that is, molecules formed from carbon and hydrogen. These substances; wood, natural gas, and oil, will emit light which will fall in the blue region. An example of this is the fire from gas cookers, which is due to the combustion of methane (CH4).
Other elements, however, can give different colors. Lithium (Li), for instance, gives a pink flame (see picture).
The different colors which elements give to the flame can be used to identify them in a compound with unknown composition...