xxxxxxxxxx
34
// 2 colors to blend, with stroke as a choice
// future: add buttons
let r, g, b, c;
function setup() {
createCanvas(windowWidth,windowHeight);
background(0);
}
function draw() {
let t;
if (width<height) {
t = width
}
else {
t = height;
}
strokeWeight(0.01);
stroke(255)
// color
r = map(mouseX,0,width,0,255,true);
g = map(mouseY,0,height,0,255,true);
b = Math.abs(r-g);
c = color(r,b,g)
c.setAlpha(3)
fill(c)
circle(width/2,height/2,(0.5*t),(0.5*t))
}
function windowResized() {
resizeCanvas(windowWidth,windowHeight)
}