Chelsea Fan-Project-05

Wallpaper

/* Chelsea Fan
Section 1B
chelseaf@andrew.cmu.edu
Project-05
*/

function setup() {
    createCanvas(400, 400);
    background(255, 250, 205);
}
var xCoord = 10; //x coordinate of rect
var yCoord = 10; //y coordinate of rect
var xRect = 10; //width of rect
var yRect = 50; //height of rect
var spacing = 20; //spacing between rect
var horiz = -16; //horiz spacing between rect
var r = 255; //red color 
var g = 220; //green color
var b = 220; //blue color

function draw() {
	for (var i = 0; i < 13; i++) {
		stroke(0); //stroke color black
		fill(r, g, b); //color of rect
	    rect((xCoord+spacing)*i+horiz*spacing, (yCoord+spacing)*i, xRect, yRect); //rectangles
	    stroke(255); //change stroke color to white
	    line(30*i, 0, 30*i, height); //vertical white stripes
	    }
	horiz = horiz + 3; 
	r = r - 3; //change in red color
	g = g + 3; //change in green color
	b = b + 3; //change in blue color

    for (var i = 0; i < 21; i++) { 
    	line(0, 20*i, width, 20*i); //horizontal white stripes
    }

}

Leave a Reply