Answer:
When the atoms of a gas or vapor are excited, for instance by heating or by applying an electrical field, their electrons are able to move from their ground state to higher energy levels. This energy corresponds to particular wavelengths of light, and so produces particular colors of light.
Step-by-step explanation: