Light detectors simply give intensity information. If you want color information you either need a detector that doesn't respond to certain wavelengths, or you need to use filters for the various wavelengths. The latter method is by far the most commonly used method. (I consider a photodetector with a built-in filter or monochromator as the latter, not former type. The former type might be represented by the cones in the retina.)
That being the case, you could consider a line follower that had two detectors. One detector would have a filter that allowed max. transmission for one color of interest and the other other would have a filter for the other color of interest. Knowing the ratio of the outputs for color 1
and for color 2 would allow you to determine which line the detector was "seeing."
From a construction standpoint, I would use fixed detectors and filters rather than one detector with movable filters, but either way will work. John
Edit: This may be a bit arcane, but I used the cones as an example of a wavelength selective detector, not filter based detector, because of the very close, molecular association of the protein opsin with the actual signal generator (See: **broken link removed**.
A better example might be the photoelectric effect one sees with LEDs in which the color sensitivity is due to the doping (See:**broken link removed**
**broken link removed**).