Give to each Ball a own skill. Red ball skill1 = 1, green ball skill1 = 2 and the blue ball skill1 = 3. You can set this skills in WED or also in SED.
Now you can use:
if(you.skill1 == 2) / so you know this ball colidies with the green one.