Han Yu Project 04 String Art

sketch

// Han Yu
// Section D
// hyu1@andrew.cmu.edu
// Project-04

function setup() {
    createCanvas(400, 300);
    background(24, 146, 245);
}

function draw() {
// the pink background
	for (var i = 0; i <400; i++) { //top
		stroke(245, 41, 143);
		line(100, 100, i, 0);
		i += 10;
	}

	for (var j = 0; j <300; j++) { //left
		stroke(245, 41, 143);
		line(100, 100, 0, j);
		j += 10;
	}

	for (var k = 0; k<300; k++) { //right
		stroke(245, 41, 143);
		line(300, 200, width, k);
		k += 10;
	}

	for (var m = 0; m<400; m++) { //bottom
		stroke(245, 41, 143);
		line(300, 200, m, height);
		m += 10;
	}

// the yellow hourglass
	for (var n = 0; n<400; n++) { //bottom
		stroke(255, 249, 57);
		line(width/2, height/2, n, height);
		n += 10;
	}

	for (var n = 0; n<400; n++) { //top
		stroke(255, 249, 57);
		line(width/2, height/2, n, 0);
		n += 10;
	}

// the concentric circles
	for (var c = 10; c<155; c++) {
		stroke(245, 41, 143);
		noFill();
		ellipse(width/2, height/2, c, c);
		c += 5;
	}

}

I was inspired by the Japanese zen garden and wanted to use a bunch of colors that contrast with each other. Making the background was the hardest part of this project because it’s tricky to make everything align. Overall, this project reinforces my skills of using for loops.

Leave a Reply