xxxxxxxxxx
void setup() {
background(255, 255, 255);
fullScreen();
}
// variables
int strokeW = 10;
int strokeR;
int strokeG;
int strokeB;
void draw() {
if (mousePressed) {
stroke(strokeR, strokeG, strokeB);
strokeWeight(strokeW);
line(mouseX, mouseY, pmouseX, pmouseY);
}
fill(255, 255, 255);
stroke(0, 0, 0);
strokeWeight(5);
rect(-5, -5, 105, 105);
textSize(16);
fill(0, 0, 0);
text("Your Stroke ^", 0, 121);
stroke(strokeR, strokeG, strokeB);
strokeWeight(strokeW);
line(50, 50, 50, 50);
if (keyPressed) {
if (key == 'q' || key == 'Q') {
strokeR++;
}
if (key == 'w' || key == 'W') {
strokeG++;
}
if (key == 'e' || key == 'E') {
strokeB++;
}
if (key == 'r' || key == 'R') {
strokeW++;
}
if (key == 'a' || key == 'A') {
strokeR--;
}
if (key == 's' || key == 'S') {
strokeG--;
}
if (key == 'd' || key == 'D') {
strokeB--;
}
if (key == 'f' || key == 'F') {
strokeW--;
}
}
if (strokeW > 50) {
strokeW = 50;
}
}