xxxxxxxxxx
76
var penkleur;
function setup() {
createCanvas(400, 351);
background("white");
strokeWeight(3);
penkleur = color("white");
}
function draw() {
if (mouseIsPressed) {
if (mouseX <= 50) {
if (mouseY <= 50) {
// kleur 1
penkleur = color(255, 153, 153);
} else if (mouseY <= 100) {
//kleur 2
penkleur = color(255, 204, 153);
} else if (mouseY <= 150) {
//kleur 3
penkleur = color(255, 255, 153);
} else if (mouseY <= 200) {
//kleur 4
penkleur = color(204, 255, 153);
} else if (mouseY <= 250) {
//kleur 5
penkleur = color(153, 204, 255);
} else if (mouseY <= 300) {
//kleur 6
penkleur = color(204, 153, 255);
} else if (mouseY <= 350) {
//kleur 7
penkleur = color(255, 255, 255);
}
}
stroke(penkleur);
line(mouseX, mouseY, pmouseX, pmouseY);
} //noStroke();
// kleurkeuzevakjes vanaf hier
stroke(color(0));
//vak 1
fill(255, 153, 153);
rect(0, 0, 50, 50);
//vak 2
fill(255, 204, 153);
rect(0, 50, 50, 50);
//vak 3
fill(255, 255, 153);
rect(0, 100, 50, 50);
//vak 4
fill(204, 255, 153);
rect(0, 150, 50, 50);
//vak 5
fill(153, 204, 255);
rect(0, 200, 50, 50);
//vak 6
fill(204, 153, 255);
rect(0, 250, 50, 50);
//vak 7
fill(255, 255, 255);
rect(0, 300, 50, 50);
print(penkleur);
textSize(45);
text("⌧", 3, 340);
fill(0, 102, 153);
}