Putting color into fireworks is a complicated undertaking, not anything like adding a couple drops of food color to your favorite cupcake frosting and instantly enjoying the rewards of your work. Instead, the process of making firework color is a complicated combination of both art and science that isn’t actually seen until the big explosion. Each blast of light that comes from fireworks is called a star and requires an oxygen producer, a fuel, a binder to keep compounds in place, and color producer. There are two main mechanisms of color production in fireworks, incandescence and luminescence. 
Incandescence is light that comes from heat. When heated, an object becomes hot and glows, first revealing infrared, then red, orange, yellow, and white light as the temperature increasingly rises. In fireworks, the pyrotechnic components, such as charcoal, can be tweaked to get a specific color at a specific time. Really, color is just fiddling with the amount of heat.  Metals that burn brightly, such as aluminum, magnesium, and titanium, are popular vehicles to manipulate the temperature, and thus color, of a firework. 
Luminescence is light created with any energy that is not heat. Scientists often call luminescence ‘cold light’, because it can occur at room temperature and below. Luminescence is made when energy is absorbed by an electron of an atom or molecule, making it excited, but unstable. When the electron returns to a lower energy state, the energy is released in the form of a photon (which is light). The amount of energy in the photon determines its wavelength (aka color). Pyrotechnicians are well versed in what types of chemicals are needed to produce the desired colors (see chart).
As you can imagine, making colorful fireworks isn’t child’s play or even for adults tinkering around without a background in the sciences. The skills of the manufacturer will greatly affect the final product, that’s why pyrotechnicians are often referred to as artists. Who can argue, especially after you see a firework masterpiece paint the sky with amazing fiery color?!