Sorting beads the easy way

If you want to measure the blueness of an object, you can shine a pure blue light at it and then measure the reflected light intensity with a photodiode. Do the same for red and green light, and you can get an RGB color value. Conversely, you can shine a...