This could probably be done fairly easily with an
Arduino. You'd just need a
color sensor and the stylus could be on a
servo. Program it so when it sees a color, the servo moves to tap the screen, then back to its original position. I haven't worked with color sensors, but servos are easy to use with Arduinos. This is a good place to get help, and I'm sure others will chime in! Most of the people here are nice and helpful.
Here's something I made using a RedBoard Arduio and the servo linked above.
__________________

"You know, it's amazing how many things you can take apart with just one ordinary screwdriver!" - Calvin, from Calvin and Hobbes
"There's nothing a little duct tape and surgical tubing can't accomplish." - Sheldon J. Plankton