In complete combustion of hydrocarbons the colour of the flame is blue. But what is the reason behind the flame being blue and not green or black or any other colour?

Edit: I've searched the web for an answer to my question but all of them just equate blue flame to complete combustion and yellow to incomplete combustion. A similar or rather the same question has been asked here on chemistry stack exchange by a user but it just has one relevant answer. The motive behind asking this question again is to get a few more answers or in other words a few more second opinions so as to get a more balanced and clearer understanding of the matter.

  • $\begingroup$ @M.Farooq Not exactly. There are three answers in all. Two of them don't answer the question and the third one isn't that easy to comprehend. $\endgroup$ Nov 2, 2021 at 14:27
  • $\begingroup$ @Obina, You can edit/expand your question about what is not clear and show your search effort. Did you search the web? $\endgroup$
    – AChem
    Nov 2, 2021 at 14:28
  • $\begingroup$ The answer by Frazky is indeed the answer. The above two are not relevant. $\endgroup$
    – AChem
    Nov 2, 2021 at 14:29
  • $\begingroup$ @M.Farooq I have edited the question. Is it clearer now? $\endgroup$ Nov 2, 2021 at 15:37
  • $\begingroup$ Unfortunately, it is closed now. The basic reason for blue flame is that hydrocarbons decompose to smaller simple diatomic molecules like $\ce{C2}$. By the intense heat of oxidations, these molecules are electronically excited. The excited molecules emit blue color. $\endgroup$
    – AChem
    Nov 2, 2021 at 15:40