Mouse click to console.log message, Press ' ' (space) to loop/noLoop, "s" to toggle between stroke and noStroke, "c" to fill random color from colors, "i" to increase circleSize, "d" to decrease circleSize
xxxxxxxxxx
/*
Control Demo
For more details, see: https://github.com/ZRNOF/p5.js-Toolbox/tree/main/Control
*/
const colors = ["#227c9d", "#17c3b2", "#ffcb77", "#fef9ef", "#fe6d73"]
let circleSize = 50
function setup() {
createCanvas(600, 600)
background(random(colors))
stroke(random(colors))
strokeWeight(10)
//ClickLoopToggle()
ClickDo(() => console.log("Click!"))
PressLoopToggle(" ")
PressToggle("s", () => stroke(random(colors)), noStroke)
PressDo("c", () => fill(random(colors)))
PressDo("i", updateSize, [5])
PressDo("d", updateSize, [-5])
}
function draw() {
circle(random(width), random(height), circleSize)
}
function updateSize(inc) {
circleSize += inc
}