Skip to content

Instantly share code, notes, and snippets.

Created October 26, 2017 12:34
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save anonymous/4c46d08275f1849826052391938fa44a to your computer and use it in GitHub Desktop.
Save anonymous/4c46d08275f1849826052391938fa44a to your computer and use it in GitHub Desktop.
int NUM = 24;
void setup(){
size(640, 640);
noStroke();
rectMode(CENTER);
}
void draw(){
background(0, 0, 30);
translate(width / 2, height / 2);
for(int i = 0; i < NUM; i++){
float angle = i * TWO_PI / NUM;
float v = pow(abs(sin(angle / 2 + frameCount * 0.03)), 4);
float r = map(v, 0, 1, 10, 20);
fill(lerpColor(color(45, 91, 80), color(191, 255, 0), v));
ellipse((150 + r) * cos(angle), (150 + r) * sin(angle), r * 2, r * 2);
}
for(int i = 0; i < NUM; i++){
float angle = i * TWO_PI / NUM;
float v = pow(abs(sin(angle / 2 + frameCount * 0.03)), 4);
float r = map(v, 0, 1, 5, 10);
fill(lerpColor(color(45, 91, 80), color(191, 255, 0), v));
ellipse((100 + r) * cos(angle), (100 + r) * sin(angle), r * 2, r * 2);
}
//noFill();
stroke(random(0,255), random(0,255), random(0,255));
strokeWeight(5);
ellipse(CENTER, CENTER, 100, 100);
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment