Popular line sensor use IR LED as transmitter and IR photodiode as receiver to distinguish reflective color such as white and less reflective color like black. Consider that infrared LED is hard to see by naked eye therefore hard to know if the LED still working or not and infrared ambient noise in not less than visible light why it is so popular?
Most likely because there are commonly available devices that have an infrared emitter and detector pair in a single unit.
Easy to install, easy to use.
There is, of course, a lot of ambient infrared. But, the detectors have a filter in front of them to only allow a certain (narrow) range of infrared wavelengths. The emitters only transmit in that particular range. This reduces interference from ambient infrared.
So, an IR emitter detector pair is actually less sensitive to ambient IR than an unfiltered visible light LED emitter/detector pair would be to ambient visible light.
You could do the same with an LED of a particular color as an emitter and a bare phototransistor or photodiode as a detector - but you would have to have a color filter to make it only receive from your LED.
There aren't many easily available filters that match the typical LED colors so you would have to find some piece of transparent plastic or glass of the correct color. Good luck with that.
There may well be commercially available colored visible light emitter/detector pairs.
IR is common, available, cheap, and gives good results so that's what gets used.