Sometimes we perceive colors with their neighbors. Our brain transfers perceived colors to its neighbors. This is called Von Bezold spreading effect or color assimilation. When there is high contrast or when the brain fills in the colors that it perceives should be present, color assimilation may be increased.
Digital media expert Øyvind Kolås also tested this optical illusion using lines and dots. He used Munker’s illusion which is a type of color assimilation where horizontal stripes of different colors create the perception of different color tones.
Here is a video about how color assimilation causes an illusion where we perceive black and white images as color: