xxxxxxxxxx
45
let diameter = 50;
function setup() {
createCanvas(400, 400);
noStroke();
background(50);
colorMode(HSB);
}
function draw() {
//background(128);
if(mouseIsPressed){
stroke(255, 255, 255, 30);
}else{
noStroke();
}
//fill(255, 0, 255, 50);
//fill(255, 255, 255, 50);
// Now in HSB, 0-360 for hue, 0-100 for saturation and luminance
let hue = map(mouseX, 0, width, 0, 360);
fill(hue, 100, 100, 0.5);
//let redAmt = map(mouseX, 0, width, 0, 255);
//fill(redAmt, 0, 0, 200);
diameter = dist(mouseX, mouseY, pmouseX, pmouseY);
circle(mouseX, mouseY, diameter);
}
function keyPressed(){
if(key == ' '){
background(50);
}
}