Different colours are observed in different flames is due to
Difference in the availability of oxygen and difference in the type of fuel.
The colour of a flame depends on both the quantity of oxygen available for burning and the type of fuel. When LPG is burnt in the presence of sufficient oxygen, the flame is observed to be blue coloured. But when the same LPG is burnt in the presence of little oxygen (air), the flame burns with a yellow shade. Also, different metals give different colours to the flame.
For example :
Lithium burns with a red flame.
Sodium burns with a yellow flame.