void setup() { size(700, 700); colorMode(RGB); background(20,1,55); noStroke(); smooth(); frameRate(16); } void draw() { int box_size; int total_mesh = 20; int base_color = 50; int y_color = 100; box_size = 700 / total_mesh; for(int i=0; i < total_mesh; i++){ for(int j=0; j < total_mesh; j++){ float xx = (j+0.5)*box_size; float yy = (i+0.5)*box_size; int e = int(random(5)); switch(e){ case 2: float r_color = random(8,y_color); fill(base_color + r_color,10,40); ellipse(xx, yy, box_size, box_size); break; } if ( (xx-20 < mouseX) && (xx+20 > mouseX)){ if ( (yy-20 < mouseY) && (yy+20 > mouseY)){ fill(255,255,255); ellipse(xx, yy, box_size, box_size); } } } } }