Note: The answer I gave uses vector math to solve the problem. If you do not know vector math you could be in trouble.
However, if you want to make any kind of action or arcade game in 2D (and 3D for that matter) you MUST learn vector math.
In fact if you want to be a game developer, you must get this skill/knowledge in your tool belt.
Just gotta.
So, my suggestion… grab a book and get crackin.
In theory (and practice), for this very limited mechanic, you could solve the detect “I hit red or blue” problem using hacks. I’m not going to tell them to you however because they are BAD BAD BAD, and I really want to encourage you to learn vector math. 