Why Things Have Color
(see description below the applet)
In this applet, white light entering from the left is dispersed with a prism, passes through the material and is recombined in the second prism. If the material, as modeled by a particle in a box, is absorbing light of a certain color, say green, the transition arrow is green and the spectrum leaving the material has the green removed. The color of the recombined light is the complement of that being absorbed. Since parameters may be entered that do not correspond to absorption of visible light, the arrow at the top shows where in the electromagnetic spectrum the n=1-2 transition of the particle-in-a-box currently lies.
This applet demonstrates elementary numerous aspects of spectroscopy. A longer explanation of ways to use the applet in the classroom is also available.