why do different compound have different colours in their visible emissions?

2 answers

different colors are indicative of different outer electron levels.
If you are talking about flame emissions (and not visible colors as we look at them), the answer is that the electrons in the elements are raised to various energy levels and they fall back to their original positions, either all at once or in steps. Different elements have different electrons in different energy levels.