Once we have subroutines to draw spirals and create transitions from color stops, we can make any number of beautiful spiral squares. In the first spiral square, I simply replace the heart with a square.

In the second spiral square, I give the square a velocity and have it bounce off of the ”walls“ of the <canvas>. This gives the spiral a nice physics effect.

In this third spiral, I use a circle instead of a square or a heart, and I draw the circle behind the scaled and rotated image from the offscreen <canvas> instead of in front of it. Oh, no! Stickman is caught in a space vortex. Thankfully, he is in his own <canvas> layer and won’t get pulled in.

Draw interactive circle spirals.