Would'nt it be something along the lines of having a high brightness green LED, which will shine a spot of light onto the ball, and a Cds cell in a light pipe focussed onto where that spot will appear on the balls surface. If the ball were green, it would reflect only a small amount of the light as it would absorb most of it. If the ball were yellow however, it should reflect more light, which should in turn lower the resistance of the Cds further. I will say this though, it would be VERY difficult to set up in any reliable way, and if the balls have numbers on them, thats sure to cause problems (can't remember if they do). Never really thought of it, but electronics seem to have difficulty recognising colours.