Which node use in Cycle to know if 2 colors are equal?
One way is to split the color in components and compare them:


This sets the material output to green if the input colors match exactly otherwise red.



Easier but works also:


Note that the larger than node has a value > 0 (I assume this is required due to rounding errors 0.001 should also work)