Skip to content

Instantly share code, notes, and snippets.

@giruzou
Forked from takawo/sketch_171224a_merry_xmas.pde
Created February 23, 2018 00:57
Show Gist options
  • Save giruzou/b883f35a362594c3ed4d7c1126d26cb6 to your computer and use it in GitHub Desktop.
Save giruzou/b883f35a362594c3ed4d7c1126d26cb6 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