Why are hydrocarbon flames yellow or blue?
It depends on the amount of oxygen available and on the ratio of hydrogen to carbon in the fuel. 

Hydrogen burns with an almost invisible flame no matter how much oxygen is present, but solid carbon burns with a yellowish (black-body) flame. If the fuel combusts in a multi-step process where all reactants are gaseous, you get a bluish flame. For example, the combustion of methane produces methanol, then formaldehyde, formic acid, carbon monoxide etc.

The combustion of acetylene at lower temperature, with little oxygen, however, starts with cracking of the C-C triple bond, releasing carbon particles that have a luminous flame.

So the greater the hydrogen:carbon ratio, the easier it is to get a blue flame.