means register the function redball as something that is called every time an object is detected, any object, no matter the color.
and you register that function everytime you see a red color, so you end up calling redball more and more the longer the code runs.
you may also find, depending on your lighting and environment, that our idea of “red” and “blue” doesn’t match what you are measuring. In that case, you will have to use hue() and determine what range of values should be red and blue.
Did you read the two year old thread you revived? (Please start new threads instead.)
It sure looks to me that this old thread covers what you need. There are also some example in VexCode. Click File then Open Examples to find some starting points.