xxxxxxxxxx
27
let value = 0;
function setup() {
createCanvas(windowWidth, windowHeight);
background(255, 0, 0);
}
function draw() {
fill(value);
rect(25, 25, 50, 50);
}
function touchMoved(px) {
console.log( )
/*
value = value + 5;
if (value > 255) {
value = 0;
}
*/
if (px < width/2) {
value = 0;
} else if (px > width/2) {
value = 255;
}
}