Color sensor reliable?
Light sensors are mainly affected by three independent variables:  


Distance between the sensor and the surface  
Color of the surface  
Amount of ambient light  


What this means is, in order to measure one of these things, the other two variables must be held constant. So, in order to measure color, the distance must be constant and the ambient light should be constant.  

You can maintain a constant distance between the sensor and the floor by attaching the sensor, pointing downward, to a fixed point on the robot. Simple enough. In my experience the sensor should be about 1cm from the floor for best results.  

You can maintain a constant ambient light by avoiding shadows or bright lights. If this isn't possible, you can build a shroud over the sensor to block out external light. You should also recalibrate the sensor at program startup to account for ambient light.  

After doing the previous two things, you can measure the reflected light from the surface by shining one of the colored LEDs and taking a sample. Using only 1 LED should be sufficient to detect differences in grayscale, but to actually measure "color" you can quickly cycle between the Red, Green, and Blue LEDs, taking samples with each, to get a crude estimate of the RGB components of the surface.