When you were staring at the red image, your brain got used to the red and suppressed the signals it was getting from red cells. When you the shifted your gaze to the white paper, your brain saw less red light as before and mentally "subtracted" red from what it as seeing. The green cells, however, hadn't been suppressed and could send full-strength signals. White "minus" red is green, hence why you saw a flash of green.