Apart from incombustible elements, the color of a hydrocarbon flame is primarily dependent on the richness of the flame that is, on how much oxygen there is to combust the fuel. In practice*, when the mixture is slightly lean (has more oxygen than required for complete combustion), the color of the combustion zone is generally blue-violet due to large amounts of high-energy radical carbon and hydrogen compounds. When the mixture is slightly rich (slightly too much fuel and not enough oxygen), the color is sometimes green due to C2 molecules breaking free, and the high-temperature products can glow red from the CO2 and H2O produced during combustion. When the mixture is very fuel rich (a poor flame, with not enough oxygen to burn properly), carbon particles form and an intense yellow radiation results from their being heated in the flame. In very rich flames often you see this in candles soot particles may impart a black color to the outer edge of the yellow flame.
Flame color comes from the energy released by the electrons of the atoms of burning gas as they are raised to higher energy states during combustion, then fall back to lower energy states. Some of this energy is released in the form of visible light. The color corresponds to frequency, which is a function of the amount of energy released. (Work with me on this.) Low energy, low-frequency light is red; medium-frequency, medium-energy light is orange, yellow, or green; and high-energy, high-frequency light is blue or violet. If the energy levels are spread over a wide range of the visible spectrum, the light will appear as white.
* Many thermodynamics and chemistry texts state that adiabatic flame temperature is highest when the flame is at perfect stoichiometry (exactly enough air to burn the fuel). Since mixing and other practical effects require extra air to ensure combustion, the hottest flames in practice tend to be slightly lean (slightly more oxygen than needed).
Chemical Flame Colors
If you want to purposely color your fire then dissolve one of these chemicals in water, soak a log in it, and let it dry.
Orange ---------Calcium Chloride (a bleaching powder)
Yellow ----------Sodium Chloride (table salt)
Yellow-Green---Borax (a laundry powder)
Green-----------Copper Sulfate (for swimming pools)
Purple-----------Potassium Chloride (fertilizer)
White------------Magnesium Sulfate (Epsom salts)
Use only one chemical per log (mixing will not produce multiple colors")
however, you may put more than one type of colorized log in the fire at once.
Instead of big logs, you can use pinecones or sawdust.
CAUTION!! Some of these chemicals are not very pleasant to get all over yourself, your clothes, the living room, or the dog. Use proper precautions (goggles etc.)