Absorption:
If the wavelength of the light happens to match the distance between two electron levels in the material, it can be absorbed. Light disappears and its energy becomes part of the heat energy of the material.
Metals have so many free electrons that all wavelengths are absorbed -- they are opaque to xrays, visible light, radio waves, everything.
Pigments have specific electron gaps that absorb only the light of a specific wavelength, which we see as color
Transparent materials do not happen to have any gaps between electron levels that match any of the wavelengths of visible light.