<style>
body { margin: 0; }
</style>
<script src="https://cdn.jsdelivr.net/npm/p5@1.3.1/lib/p5.js"></script>
<script>
function setup(){
createCanvas(500,200);
s = createSlider(0,255,12);
s.position(10,20);
}
let alphaVal = 0;
function draw(){
alphaVal = s.value();
background(0,alphaVal);
fill(255);
circle(mouseX,mouseY,20);
}
</script>
Why low alpha values cause trails behind? Does p5 keeps track of all the things drawn since the previously drawn circles can be seen when background has transparency? Does that affect performance?