How does idea of something being quantized relate to the lab we did this week. Why do elements emit very specific colors of light when heated?

How does idea of something being quantized relate to the lab we did this week. Why do elements emit very specific colors of light when heated?