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