Each color works the same way. As different elements ignite they release different wavelengths of light which translate as different colors. Not all colors of fireworks are equally easy to create.