Skip to content

Instantly share code, notes, and snippets.

Created Oct 26, 2017
Embed
What would you like to do?
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