xxxxxxxxxx
54
var lines = {
x: 0,
c: 0,
y: 0,
u: 400
};
var circleY = 0;
var rgb = {
r: 0,
g: 0,
b: 0,
a: 0
};
var circleX = 0;
var rad = 50;
function setup() {
createCanvas(400, 400);
background(100);
hue = 0;
}
function mousePressed() {
lines.x = 0;
lines.c = 0;
}
function draw() {
colorMode(HSL, 360);
R = map(hue, 0, 360, 0, 250);
// G = map(mouseY, 0, 400, 0, 255);
B = map(circleY, 0, 400, 0, 255);
stroke(hue, 200, 200);
line(lines.x, lines.y, lines.c, lines.u);
lines.x = lines.x + 1;
lines.c = lines.c + 1;
if (lines.x> 400) {
lines.x= 0
}
if (lines.c > 400) {
lines.c = 0
}
if (hue > 360) {
hue = 0;
} else {
hue = hue + .5;
}
}