xxxxxxxxxx
27
function setup() {
createCanvas(windowWidth/2, windowWidth/2);
}
function draw() {
let redValue = map(mouseX, 0, width, 0, 255);
let blueValue = map(mouseY, 0, height, 0, 255);
let greenValue = map(mouseX + mouseY, 0, width+height, 0, 255);
background(redValue, greenValue, blueValue);
let value=5;
console.log(map(value, 0, 10, 0, 20));
let myWidth = 300+(sin(frameCount/25)*70);
let myHeight = 300+(sin(frameCount/15)*50);
noStroke();
fill(50, 150, 200);
ellipse(width/2, height/2, myWidth, myHeight);
}
function windowResized() {
resizeCanvas(windowWidth/2, windowWidth/2);
background(238, 130, 238);
}