The amount of reflection light will depend upon the color of the surface from which it is being reflected. Black is said to be perfect absorber and white is to be said perfect reflector. The reflection will be different for different colors. Thus make it a color detector.
int ir=8;
void setup() {
// put your setup code here, to run once:
Serial.begin(9600);
pinMode(ir,OUTPUT);
}
void loop() {
// put your main code here, to run repeatedly:
Serial.println(digitalRead(ir));
}