Why do different metal ions release different colors of light?
You are right, it depends on the energy level of valance electrons, but more precisely it depends on the difference between the highest occupied and lowest unoccupied levels' energies. If the energy difference is $\Delta E$ then the light emitted by the excited atom has a frequency $\nu = \frac{\Delta E}{h}$ so a wavelength $\lambda = \frac{c}{\nu}=\frac{h c}{\Delta E}$