clear()
Clears the pixels on the canvas.
clear() makes every pixel 100% transparent.
Examples

function setup()
size(100, 100)
background(200)
describe('A gray square. White circles are drawn as the user moves the mouse. The circles disappear when the user presses the mouse.')
end
function draw()
circle(mouseX, mouseY, 20)
end
function mousePressed()
clear()
background(200)
end
Syntax
clear()
Related
This reference page contains content adapted from p5.js and Processing by p5.js Contributors and Processing Foundation, licensed under CC BY-NC-SA 4.0.