Here's why:
* Resonance: When light of a specific frequency interacts with glass, the electrons in the glass molecules can absorb the energy and start vibrating. This is similar to pushing a swing at its natural frequency - it resonates and absorbs the energy.
* Absorption: If the light frequency matches the natural frequency of the glass, the energy is efficiently absorbed by the electrons, preventing the light from passing through.
* Opacity: This absorption of light at specific frequencies makes the glass opaque to that particular color of light. For example, if a certain type of glass absorbs light in the green portion of the spectrum, it will appear red because the other colors (like red) are transmitted.
Important Note: While glass is opaque to its resonant frequencies, it's transparent to a wide range of other frequencies. This is why we see the world through glass windows - the glass transmits the visible light spectrum (except for its resonant frequencies, which are usually outside the visible range).