Skip to content

Commit

Permalink
inky blobs
Browse files Browse the repository at this point in the history
  • Loading branch information
vpicone committed Aug 3, 2021
1 parent 077d67a commit fb922d2
Showing 1 changed file with 7 additions and 8 deletions.
15 changes: 7 additions & 8 deletions sketch.js
Original file line number Diff line number Diff line change
Expand Up @@ -26,12 +26,12 @@ class Blob {
let blobs = [];

function setup() {

blob1 = new Blob(random(0,640), random(random(0,360)));
blob2 = new Blob(random(0,640), random(random(0,360)));
blob3 = new Blob(random(0,640), random(random(0,360)));
colorMode(HSL);
createCanvas(windowWidth/2, windowHeight/2);
blob1 = new Blob(random(0,width), random(random(0,height)));
blob2 = new Blob(random(0,width), random(random(0,height)));
blob3 = new Blob(random(0,width), random(random(0,height)));
blobs = [blob1, blob2, blob3];
createCanvas(640, 360);
fill(0, 102, 153);
textSize(32);
pixelDensity(1);
Expand All @@ -47,10 +47,9 @@ function draw() {
let sum = 0;
blobs.forEach(blob => {
const distance = dist(x, y, blob.pos.x, blob.pos.y);
sum += 250 * blob.r * unity / distance;
sum += 2000 * blob.r / distance;
})
colorMode(RGB, x ^ y + 220);
set(x, y, color(sum, 150, 100));
set(x, y, color(sum % 360 - 200));
}
}
updatePixels();
Expand Down

1 comment on commit fb922d2

@vercel
Copy link

@vercel vercel bot commented on fb922d2 Aug 3, 2021

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Please sign in to comment.