To understand photosynthesis, we must first understand a bit about light. Light is a form of electromagnetic energy, meaning it travels as a wave and does not require a medium to move through. Light, unlike sound, can travel to us from the sun through the vacuum of space. Once it gets to Earth, there are particles for it to either reflect off of, be absorbed by, or pass through. Depending on the length of the light wave--think about stretching or compressing a slinky--and whether it is reflected or not, our eyes will either interpret it as different colors, or we will not be able to see it at all. In fact, our eyes only pick up a tiny fraction of the light spectrum.
When we look at objects, we may see them as being a certain color. This is because that object reflects that particular wavelength of light back at us. Objects that are white reflect the entire spectrum back at us. Objects that are truly black absorb all of the light, reflecting nothing back. Objects that are a particular color, such as green, absorb all of the other wavelengths of visible light except green, reflecting that green out to our eyes. Pigments are molecules that reflect specific colors.