Sensing optical tape
Reflectivity differences can be sensed using optoelectronic components. An Emitter and a Receiver are arranged so that more of the Emitter's light is seen by the Receiver when the target are is white, than when it is black.
Emitters provide a cone of illumination, and receivers have a cone of sensitivity, sometimes called a receiving angle. These components are available with narrow (e.g. 10 degrees) through wide (e.g. 130 degrees) full-width cones. You can aim the Receiver and the Emitter so that their cones overlap at the desired detection distance.
Infrared (IR) opto devices are popular, as are visible light (usually red.) Infrared has the advantage that Receivers are somewhat most sensitive in IR, and daylight and indoor illumination are low in IR thus avoiding that confounding factor. IR Receivers are often encapsulated in black or dark blue plastic that is transparent to IR, thus even more attenuating ambient visible light. 900nm is a typical IR wavelentgh.
Visible light opto devices have the advantage that you can better see what you are doing, and they are pretty. 660nm is a typical red wavelength.
Infrared emitters are sometimes called IREDs. Visible light emitters are just called LEDs.
Receivers may be phototransistors or photodiodes. Phototransistors have more gain: more current for a given amount of light. The have the disadvantage of being slow, typically 5uS rise time vs. 5nS for photodiodes. They also have more variability in gain, part-to-part, and more dependence of gain upon tempertature.