I think it will probably work OK in practice. But in theory it may not work for all coloured objects. This is why:
Most colour sensors use a true white light to illuminate the object, a white that contains all possible colours. Then 3 colour filters are used in front of the sensor(s). The colour filters have a peak "transparency" (I can't think of the exactly correct word) at red, green and blue wavelengths, but also allow wavelengths either side of that peak to pass, but with decreasing transparency as the wavelength gets further from the peak.
Using an RGB led, even when the colour is apparently white, its not truly white, it actually contains wavelengths in 3 narrow bands around red, green and blue.
So imagine an object that reflects only yellow light, i.e. only reflects wavelengths in a fairly narrow band around yellow in the spectrum.
With a traditional colour sensor, the true white light contains some yellow wavelengths. These are reflected and can pass through the red and green filters. The sensor can then interpolate between the readings from the red and green sensors and figure out that the object is yellow.
With the RGB idea, the light source contains no yellow wavelengths, so the object appears dark when illuminated with either red or green wavelengths, and the sensor can't determine the colour.
In practice, most "yellow" objects will reflect a range of wavelengths centred around yellow, and will therefore reflect some red and some green light, enabling the sensor to detect the object.
Here endeth the physics lesson....
Paul