Because I thought this would be a good idea for an action, I made one that is comprehensive enough so that you can specify how many colors should be compared to one another and what parts (r, g, b, a, or any combination between them).
With it you can send single events on matching occurrences or save as a bool, if at least one color matched the specified part of the main color.
Even though you already created a small fsm that handles your requirements, you might still want to use my action to cut down the logic into one action.
I'll probably put it onto the ecosystem soon enough, but for now you can find it in the attachments to this post.