Dots, with some flicker, move to the right. Occasionally, a grid appears, which moves right- or downwards. Follow a grid crossing with your eyes, and note that the colors change! Follow the rightward movement: the dots flicker yellow. Follow the downward movement: the dots are clearly either red or green. (Tracking with a finger can help.)
What to do
You can use the radio buttons (•0 •1→ •2↓) (or press keys 0/1/2) to select grating direction, or no grating. Without the grating, you can select for yourself whether to track the right- or downwards movement with your eyes, and thus change color.
You can change the distance between the oblique dot arrangements.
You can change the dot radius
You can change the dot colors. I made the green a little darker, so it has the same luminance as the red, reducing flicker
You can change the animation delay in frames (to find out what’s really happening).
This is an entry to the 2019 Illusion Contest. I don’t know yet how it will be placed, but I like it best. [Update: 2nd place. Congratulations, Haruaki Fukuda!]
Following along with the eyes is called “smooth pursuit”. We are very good at that, nearly w/o error.
If the smooth pursuit is rightwards, the retinal location for the dots see alternately red and green in rapid succession (≈30 Hz); at the same retinal place. Under that condition the colors mix additively and you see yellow with some residual flicker.
If the smooth pursuit is downwards, the red and green dots stay always at the same retinal location, the colors are not mixed, and are seen separately.