Contrast illusions are when you are tricked into thinking that some color is lighter or darker than it actually is. A simple example is demonstrated here by Arthur Gugick. Those gray squares are exactly the same color. A more complicated illusion is the checkershadow illusion invented by Edward Adelson, virtually recreated in LEGO by Nachapon. Here tiles A and B are exactly the same shade. I've seen both physical and mental explanations for these. The physical explanation lies in the way adjacent receptors in the eye enhance or inhibit each other. If a receptor is stimulated by the gray color, and the adjacent receptor is being stimulated by the white, the physical response is different from a receptor stimulated by the gray adjacent to a receptor stimulated by the black. The mental explanation is easier to explain for the second example. Since we know that objects in the shadow will appear darker, when we see that tile shadowed by the barrel, our mind simply assumes that it's actually a lighter color, and the reverse can be said about objects in direct light. So A and B seem to be different based on our assumptions of objects being in light or being in the shade.