Flame color depends on several factors, mainly oxygen supply, generated heat, carbon particles and the burning material with the movement of electrons in the metal ions. Thus all flame colors are not the same and different flames have different colors, like the flame color of a candle is different from the flame colors of a burning wood or a gas burner.
Each flame is multicolored, being mostly blue at the bottom, then orange or yellow and finally black at the top. The blue color signifies the hottest temperature zone of any flame. Since fire needs oxygen to burn, and as the bottom of the flame does not get much oxygen, it is the hottest spot in the flame and is blue in color. The flame gradually cools and changes color as it moves away from its source, because it is exposed to more oxygen. The temperature change causes the color of the flame to turn from blue at the hottest lower portion, to the typical bright yellowish-orange or bright orange color at the upper part. The shade of orange at the upper portion of the flame (where the flame is the coolest) depends upon the material being burned. The product of the burnt carbon, when it has cooled, is black soot, and comprises the top part of the flame.
Now, if we get into a little bit of physics, we will understand the scientific reasoning behind the color of a flame. When a material is heated, the electrons gain energy and jump to a higher level. However, they jump back to their initial level to maintain the stability. For this, each of these electrons releases the excess energy. Each jump involves a specific amount of energy being released as light energy, and each corresponds to a particular color. As a result of all these jumps, a spectrum of colored lines is formed. The color you see is the combination of all these individual colors. The exact sizes of the possible jumps in terms of energy vary from one metal ion to another. This means each ion will have a different pattern of spectral lines, and thus a different flame color.