xxxxxxxxxx
88
// number keys are colors 1= black 0= white and numbers 2-7 are roygbp
// keys JKL change the size variation of the brush, J being smallest and L being biggest
// S saves the image, C clears it and E is the eraser /kind of/
function setup() {
createCanvas(600, 600);
//noCursor()
frameRate(60);
background(220);
}
var fillColor;
var brushSize = 10;
var offSet = 10;
let STROKE = "black";
let StrokeWeight = 5;
function mouseDragged() {
var n = random(3, 6);
for (var i = 0; i < n; i++) {
noFill();
//stroke('fillColor')
var x = mouseX + random(-offSet, offSet);
var y = mouseY + random(-offSet, offSet);
var s = brushSize + random(-5, 10);
rect(x, y, s);
}
//stroke("black");
//strokeWeight(2);
//line(mouseX, mouseY, pmouseX, pmouseY);
//fill("pink");
}
function keyTyped() {
if (key === "c") {
background(220);
}
if (key === "s") {
save("drawing.jpg");
}
if (key === "2") {
stroke("red");
}
if (key === "3") {
stroke("orange");
}
if (key === "4") {
stroke("yellow");
}
if (key === "5") {
stroke("green");
}
if (key === "6") {
stroke("blue");
}
7;
if (key === "7") {
stroke("purple");
}
if (key === "1") {
stroke("black");
}
if (key === "0") {
stroke("white");
}
if (key === "e") {
stroke(220);
}
if (key === "j") {
offSet = 5;
}
if (key === "k") {
offSet = 10;
}
if (key === "l") {
offSet = 20;
}
}
function draw() {
//background(220);
//fill("black");
//ellipse(mouseX, mouseY, 10);
//strokeWeight(2);
//line(mouseX, mouseY, pmouseX, pmouseY);
//fill("black");
// ellipse(pmouseX, pmouseY, 7);
}