xxxxxxxxxx
48
let points = []
let spill = 0
let toggle = true
let img
// let x, y
function setup() {
img=createCanvas(windowWidth,windowHeight);
// colorMode(HSB)
// background(220);
// stroke(10, 80, 80, 0.04)
background(0)
stroke(255,100)
}
function draw() {
// background(0,10)
if (mouseIsPressed) {
Ink(mouseX, mouseY)
} else {
spill = 0
points = []
}
}
function Ink(x, y) {
points.push([x, y, random(), random(1, 8)])
for (let i = 0; i < points.length; i++) {
strokeWeight(points[i][3])
point(points[i][0] + noise(spill / 1000 + i) * 15, points[i][1] + (spill * (points[i][2])) - (i * points[i][2]))
}
spill++
}
function keyPressed() {
if (keyCode == 32) {
clear()
background(0);
points = []
}
}
function keyTyped() {
if (key === 's') {
saveCanvas(img, 'drips-1', 'png');
}
}