1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
/***************************************************************************************************
/* Erik Kastner - moving color field with perlin noise
/* inspired by: http://www.flickr.com/photos/digitaltribes/2282828255/in/pool-564856@N20
/* (but totally different
/***************************************************************************************************/

color[] colors;

void setup() {
  size(400,400,P3D);
  background(0);
  frameRate(10);
  colors = new color[3];
  colors[0] = color(185,18,27);
  colors[1] = color(246,228,151);
  colors[2] = color(189,141,70);
}

void draw() {  
  background(0);
  noStroke();
  
  for (int y=0; y<14; y++) {
    for (int x=0; x<14; x++) {
      int colorIndex = floor(noise(x-frameCount,y)*3);
      int xPos = x*width/14+15;
      int yPos = y*height/14+15;

      fill(colors[colorIndex], random(100,150));
      ellipse(xPos, yPos, width/14, height/14);
      
      fill(colors[colorIndex], random(150,190));
      ellipse(xPos, yPos, width/14-10, height/14-10);
      
      fill(colors[colorIndex], random(210,240));
      ellipse(xPos, yPos, width/14-20, height/14-20);
    }
  }
}