SpiralColors

edited March 2014 in Share Your Work

screenshot-01707

Just playing around and ending up here...

Code:

void setup() {
  size(1280, 720);
  strokeCap(SQUARE);
  background(255);
}

void draw() {
  if (frameCount % 50 == 0) {
    int numIterations = 30;
    int numShapes = 30 + int(cos(10 + frameCount*0.002) * 10);
    colorMode(HSB, numShapes, 100, 100, 100);
    translate(width/2, height/2);
    float theta = TWO_PI / numShapes;
    noFill();
    strokeWeight(12 + sin(frameCount*0.01) * 5);
    float rad = 80 + cos(20 + frameCount*0.005) * 10;
    for (int j=0; j<numIterations; j++) {
      pushMatrix();
      scale(j * (0.5+0.5*noise(frameCount*0.002)));
      for (int i=0; i<numShapes; i++) {
        float start = j + i * theta;
        float stop = j + (i + sin(frameCount * 0.01) * 0.25 + 0.35  ) * theta;
        stroke(i, 90, 100, 80);
        arc(0, 0, rad, rad, start, stop);
      }
      popMatrix();
    }
  }
  filter(random(1)<0.5?DILATE:BLUR);
}
Sign In or Register to comment.