Daily Creative Coding

元「30 min. Processing」。毎日、Creative Codingします。

三日月ルーパー

f:id:aa_debdeb:20161015122025j:plain

crescent looper - OpenProcessing

/**
* crescent looper
*
* @author aa_debdeb
* @date 2016/10/21
*/

color c1, c2, c3;

void setup(){
  size(640, 640);
  strokeWeight(2);
  mousePressed();
}

void mousePressed(){
  c1 = color(random(255), random(255), random(255));
  c2 = color(random(255), random(255), random(255));
  c3 = color(random(255), random(255), random(255));
}

void draw(){
  background(c1);
  translate(width / 2, height / 2);
  stroke(c3);
  fill(c2);
  ellipse(0, 0, 450, 450);
  fill(c1);
  ellipse(7 * cos(frameCount * 0.07), 7 * sin(frameCount * 0.07), 440, 440);
}