How do they do that?
In the UK, Sir Humphrey Davy realised that metal salts burning would change the colour of the flame. (Remember those school chemistry lessons?) That was in the 1790s. It's taken since then to perfect a formula that will allow a candle to burn in this way.
Of course fireworks have exploded with coloured sparks for hundreds of years, since the Chinese first pioneered them. And mankind has been playing with fire for centuries!