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 are yellow. Follow the downward movement: the dots are clearly either red or green. Switch the grid off (🔘 0) and track with a finger at the right speed – no trick here :).
What to do
You can use the radio buttons (🔘0 🔘1→ 🔘2↓, or press keys 0/1/2) to select grating direction, or off. 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, especially with the help by the grid movement.
If the smooth pursuit is rightwards, the projection of the dots on the retinal alternates red and green in rapid succession (≈30 Hz) at the same retinal place. Thus our photoreceptors see rapid color flicker, leading to flicker fusion. Then the colors mix additively and you see yellow; I tried to set the colors at same luminance to minimize flicker (red full, green a little darker).
If the smooth pursuit is downwards, the red and green dots stay always at the same retinal location, there is no local flicker, the colors are not mixed, and are seen separately.