xxxxxxxxxx
30
let diameter= 50;
function setup() {
createCanvas(600, 400);
background(190);
noStroke();
}
function draw() {
// background(220);
if(mouseIsPressed == true){
noFill();
stroke(200, 0, 200, 80);
}else{
// fill is taking red, green, blue, opacity
// from 0 to 255 where 255 is max
fill(200, 0, 200, 80);
}
diameter = dist(mouseX, mouseY, pmouseX, pmouseY);
circle(mouseX, mouseY, diameter);
}
function keyPressed(){
print(key);
if(key == ' '){
background(190);
}
}