At the heart of every camera is the medium whereby it translates light into an image. Without this process, photography couldn’t exist. In the case of film photography, the light actually brings about chemical changes in the film that record the light’s information at a molecular level. All digital photography relies on using light to affect electrons and (at least at present) involve semiconductors, but not all methods of accomplishing this goal are equal.
First, the similarities: Both devices exploit the photoelectric effect, the fact that, if you “hit” a bound electron with a photon of energy greater than that with which it is bound to an atom, you can knock it free. Since the energy of a photon is dependent on its frequency, different metals will respond to different colors of light. Increasing the intensity of light increases the number of electrons dislodged, but doesn’t increase their energy. If you know what energy the electrons have when they reach you, you can figure out their color. Place individual detectors in a grid, and you can even figure out what location the photon “belongs” to.