Afterimages are explained by the opponent processing theory as the result of the neutral color exhausting itself, so when these colors tire, their opponent colors show. For example if you look at a blue, red, and black flag and then look at a blank background you will see the afterimage of the opponent colors yellow, green, and white
The three color pairs are blue and yellow, red and green, and black and white