The colour of fire is determined by the chemical composition of the fuel and the temperature at which it is burning.
We see fire because energy is given off in the form of light as well as heat. Fires are commonly hydrocarbons burning in the presence of oxygen, giving rise to fine soot particles that emit yellow light when they burn at around 1,000 degrees Celsius (1,832 degrees Fahrenheit).
Some materials produce different-coloured flames when they burn, such as lithium and copper, which produce pink and green flames respectively. This is because the wavelength of emitted light for burning materials is characteristic of each element involved.