xxxxxxxxxx
22
function setup() {
createCanvas(500, 500);
}
function draw() {
//CODE ALONG!
//Map a variable to change the background color from black to white - it should be black on the far left and white ONLY when you reach the far right edge.
background(220);
//YOUR TASK!
//1. Map a variable to control the strokeWeight of the rectangle based on mouse position, but only allow the strokeWeight to change between 5 and 20.
//2. Map a variable to control the width AND height of the rectangle (use the same variable for both) but only allow the size to change between 75 and 175.
//3. Map a variable to control one color in a fill based on mouse position, but only allow it to change between 0 and 255.
strokeWeight(5)
fill(255,0,255)
rect(210,210,75,75)
}