Checkershadow optical illusion

One of the best optical illusions I've ever encountered:



The squares labelled A and B are exactly the same color.


Here is a proof in which the first illustration has been overlain by two gray bars; note how the bars blend equally with square A and square B.



No matter how many times I look at this, and no matter how logically I think about it, I still cannot wrap my mind around the reality.