That would be unusual gameplay, but can be done by counting animation frame. For example red=0, purple=1, blue=2. Say first pick is purple, so we store the animation frame value to variable "pick_color". Then we add 1 for second pick that will equal to 2 which is blue. Third pick will return value 3, so set variable "pick_color" %3 everytick to loop the value back to 0.
Anyway you may found auto-match interesting: