All the pixels at the beginning are random, then very frame the pixels with less than 3 of their own color around die. This leads to the clustering effect of the colors, and eventually the extinction of every color except one.
Performance is significantly better in TurboWarp https://turbowarp.org/1271209219 Every frame, each pixel is killed when it has less than 3 similar pixels, or "friends" touching it. Then a pixel is killed if it has less than 2 friends before drawing the frame. The second kill is just to make the borders between clusters less noisy. Friends are also counted if they are on the other side of the screen. (left and right are connected, as well as top and bottom)