a rotating color grid
Channel:
Subscribers:
831
Published on ● Video Link: https://www.youtube.com/watch?v=X-5uk5qQmy4
This p5.js code creates a rotating color grid. The setup() function initializes a 400x400 canvas and calculates the number of grid cells. In draw(), the background is set to black, and the canvas is translated to its center to allow rotation. The grid is drawn using nested loops, and each cell is filled with a gradient color interpolated between cyan and magenta. rotate(radians(angle)) spins the entire grid, increasing angle by 0.5 per frame, creating a smooth rotation effect.