Congratulations! Your answer is correct.
Gunpowder consists of charcoal, saltpeter, and sulfur. It is also known as black powder. Since 1781, black powder has a saltpeter to charcoal to sulfur weight ratio of 75:15:10.
The burning of gunpowder does not take place as a single reaction. The exothermic process can be simplified to: 10 KNO3 + 8 C + 3 S → 2 K2CO3 + 3 K2SO4 + 6 CO2 + 5 N2. Sulfur and charcoal act as fuels, they produce hot gases when burned that expand rapidly, according to Charles’ Law. Saltpeter is an oxidizer.
When metal salts are added, they release energy when burned. By this their electrons get excited and release excess energy as light. The light’s color depends on the metal.
For more information on fireworks see: