Why is the color of a flame yellow-orange?

Why is the color of a flame yellow-orange?

Bright yellow flames on the birthday candles studding an iced cake. Dusky blue flames circling the burner of a gas stove. Dancing yellow-orange flames crackling over wood in the fireplace, with flashes of red, green, and blue. Fire comes in a rainbow of colors, some rarely seen outside a science lab.
quanswer.com