In simple terms, coloring can be divided into two main causes: chemical and physical. These chemical colors appear because they absorb some of the white light and reflect the rest. What is interesting about "chemical" coloring is that light really does affect the object. When light shines on a leaf, or a daub of paint, or a lump of butter, it actually causes it to rearrange its electrons in a process called "transition." There the electrons are, floating quietly in clouds within their atoms, and suddenly a ray of light shines on them. Imagine a soprano singing a high C and shattering a wineglass, because she catches its natural vibration. Something similar happens with the electrons, if a portion of light happens to catch their natural vibration. It shoots them to another energy level and that relevant bit of light, that glass-shattering "note," is used up and absorbed. The rest is reflected out, and our brains read it as a "color."
The best way I've found of understanding this is to think not so much of something "being" a color but of it "doing" a color. The atoms in a ripe tomato are bust shivering—or dancing or singing; the metaphors can be as joyful as the colors they describe— in such a way that when white light falls on them they absorb most of the blue and yellow light and they reject the red—meaning paradoxically that the "red" tomato is actually one that contains every wave-length except red. A week before, those atoms would have been doing a slightly different dance—absorbing the red light and reflecting the rest, to give the appearance of a green tomato instead.
Text excerpted from: "Color, The Natural History of the Palette" by Victoria Finlay