Pigments are created by modifying which colors are absorbed.
Another way to make colors is to absorb some of the frequencies of light, and thus remove them from the white light combination. The absorbed colors are the ones you don't see -- you see only the colors that come bouncing back to your eye. This is known as subtractive color, and it's what happens with paints and dyes. The paint or dye molecules absorb specific frequencies and bounce back, or reflect, other frequencies to your eye. The reflected frequency (or frequencies) are what you see as the color of the object. For example, the leaves of green plants contain a pigment called chlorophyll, which absorbs the blue and red colors of the spectrum and reflects the green.
You can explain absorption in terms of atomic structure. The frequency of the incoming light wave is at or near the vibration frequency of the electrons in the material. The electrons take in the energy of the light wave and start to vibrate. What happens next depends upon how tightly the atoms hold on to their electrons. Absorption occurs when the electrons are held tightly, and they pass the vibrations along to the nuclei of the atoms. This makes the atoms speed up, collide with other atoms in the material, and then give up as heat the energy they acquired from the vibrations.
The absorption of light makes an object dark or opaque to the frequency of the incoming wave. Wood is opaque to visible light. Some materials are opaque to some frequencies of light, but transparent to others. Glass is opaque to ultraviolet light, but transparent to visible light.