Skip to content

Instantly share code, notes, and snippets.

@takawo
Last active February 23, 2018 00:57
Show Gist options
  • Save takawo/00f5b3155956ad158348c213e572304d to your computer and use it in GitHub Desktop.
Save takawo/00f5b3155956ad158348c213e572304d to your computer and use it in GitHub Desktop.
int num = 50;
PVector[] points = new PVector[num];
void setup() {
size(320, 240);
colorMode(HSB, 360, 100, 100, 100);
noStroke();
for (int i = 0; i < points.length; i++) {
float x = random(width);
float y = random(height);
points[i] = new PVector(x, y);
}
}
void draw() {
randomSeed(100);
background(0, 0, 0);
for (PVector p : points) {
float d = random(5, 35);
float n = noise(p.x/5f, p.y/5f, frameCount/10f);
float hue = map(n, 0, 1, 0, 60);
fill(hue, 80, 100, 60);
ellipse(p.x, p.y, d, d);
p.x -= 1;
if (p.x < 0) p.x += width;
}
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment