// Christine Seo
// Section C
// mseo1@andrew.cmu.edu
// Project-04
function setup() {
createCanvas(300, 400);
mouseClicked();
}
function draw() {
}
function mouseClicked() {
background(245, 229, 254);
noStroke();
push();
for(var x = 0; x <= width; x += 30){ //rainbow dashes
for(var y = 0; y <= height; y += random(90)){
var r = random(220);
var r1 = random(0, 5);
var r2 = random(10, 40);
colorMode(HSB,200);
var colorC = color(r,r2,220);
fill(colorC);
ellipse(x, y, r, r1);
}
}
pop();
push();
for (var y = 0; y < height; y += random(80)){
strokeWeight(random(1, 5));
stroke(250);
line(0, 0, y-80, height/2); //top white lines
line(width, height, y-80, height/2); //lower white lines
}
pop();
strokeWeight(random(1, 5));//midline in center
stroke(250);
line (0,height/2,width,height/2);
push();
for (var y = 0; y < height; y += random(40)){ //dark gray lines left bottom corner
strokeWeight(random(1, 5));
stroke(100);
line(0, y, y+10, height);
}
pop();
push();
for (var x = 0; x < width; x += random(40)){ //dark gray lines right top corner
strokeWeight(random(1, 5));
stroke(100);
line(x, 0,width, x+10);
}
pop();
push();
for (var x = 0; x < width; x += random(20)){ // light gray lines right top corner
strokeWeight(random(1, 2));
stroke(160);
line(x-35, 0,width, x+35);
}
pop();
push();
for (var y = 0; y < height; y += random(20)){ // light gray lines left bottom corner
strokeWeight(random(1, 2));
stroke(160);
line(0, y-35, y+35, height);
}
pop();
}
For this project, I wanted to play having a color scheme as well as use different corners of the canvas to create lines. When clicked, the movement of the lines are random (with restriction). Although getting the gist of using for() was difficult at first, I was able to get a hang of it and create something that I think is very successful.