The Comparison node offers you the ability to use a logical comparison operator as a way to combine textures. The node takes four inputs: the first two inputs are the textures for comparison. The second two inputs are the result of the comparison.

This is a conditional Texture node for altering a given texture (input A) based on another texture (input B). In its simplest form, the Comparison node is used to select between two alternative textures at render time.

The settings shown in the figure above is the third materials in the image below.
The first and second materials are the two images used for input to compare with each other.
The difference in colors of the Logo (red and white) result in yellow (RGB 255/255/0) and all other colors that are the similar in both Logo result in blue (RGB 0/128/255)