Further to Chris Jones' answer, it might be much simpler - if the OP is just asking for a way to differentiate between a white surface and a black surface, the white surface will typically reflect more IR radiation than a black one. So, you can rig up an IR LED shining outwards, and an IR phototransistor or photodiode to measure the reflection. There are various ways to implement the detection circuit, but one way I’ve used is to wire up an IR phototransistor in series with a variable resistor (to provide a sensitivity control), creating a voltage divider (resistor on the top half, phototransistor on the bottom half). I then created a second voltage divider using two equal-value resistors, and then fed these two voltages into a comparator.
As the amount of IR light reflected back to the phototransistor rises, it starts to conduct more, so the voltage produced by the divider drops. When this crosses the threshold (defined by the fixed voltage divider), the comparator switches.
Here's an example circuit (credit: seekic.com):