PR23 IR sensor is sensing the brightness of the IR ray reflected back from the surface. black and white surface has very distinct difference in the capability of reflecting IR light. that's why it can detect which IR pair/s is/are on the black colour track and do the line following function.
whether it can be used on other colour line follow is depending on what colour which will be used;reflection characteristic of the two color, and too some adjustment on the preset to set a different threshold.
CMU cam
http://www.cytron.com.my/viewProduct.php?pid=Ah4lNg0KKS8ENhojJwosE9ddh6oBMp8UGa/OZKzRq7E=&store=is great in colour sensing for line following.