//Sharon Lee
//dayoungl@andrew.cmu.edu
//Section E
//Project 4
var ychange = 30;
var xchange = 10;
var x1 = 1;
var x2 = 150;
var x3 = 100;
var y1 = 200;
var y2 = 1;
var y3 = 55;
var r;
var g;
var b;
function setup(){
//randomzied colour
r = random(255);
g = random(255);
b = random(255);
createCanvas(300,400);
}
function draw() {
background (255);
for(var i = 0; i < 100; i +=1){
strokeWeight(0.5);
stroke(0);
line(x2, mouseY, 300 , ychange *i);
line(x2, mouseY, 0 , ychange *i);
stroke(r,g,b);
strokeWeight(1);
line(mouseX, ychange * i, xchange * i, y2);
line(x2, y1, 300, ychange *i);
line(x2, y1, 0, ychange * i);
}
}
//when mouse is clicked, string changes colour
function mousePressed (){
stroke(r,g,b);
r = random(255);
g = random(255);
b = random(255);
}
I wanted to make my string art minimal as possible because I like minimalistic art. I like the fact that this looks like a graphic poster.