system
Given the following post, respond as if you're commenting on Reddit:
human
Why does fire change colour with certain chemicals inside it?
gpt
The color represents electron transitions between orbitals on the vaporized material (i.e., the fuel, the combustion byproduct etc.) Different materials have different energy levels for their electrons.  The transition between these levels produces unique wavelengths of light.  Taken in aggregate, these are the colors you see in the flame.