Katherine Hua – Project 04 – String Art

sketch

function setup() {
    createCanvas(400, 300);

}

function draw() {
	background(0);

	//creating variables for starting point of lines (indicated by 1) and the ending points of the line (indicated by 2)
    var x1;
    var y1;
    var x2;
    var y2;

    //creating the two circles in the center
    noStroke();
    fill(232, 140, 114);
    ellipse(175, 125, 90, 90) //orange circle

	//creating the black lines going through the orange circle
	x1 = 70 
	y1 = 85;
	x2 = 200;
	y2 = 85

	strokeWeight(6);
	stroke(0);
	for (i = 1; i < 10; i++) {
		line(x1, y1, x2, y2);
		y1 += 10 //the height of starting point is moving down
		y2 += 10 //height of the ending point is moving down as well
		x2 -= 10 // line is getting shorter with each iteration
	}

	noStroke(); 
	fill(200, 42, 35);
	ellipse(200, 150, 75, 75); // red circle

	// creating the white lines crossing through the center
	strokeWeight(1);
    stroke(255, 255, 255);
    x1 = 0;
    y1 = 0;
    x2 = 400;
    y2 = 300;
    for (i = 0; i < 41; i ++) {
		line(x1, y1, x2, y2);
		x1 += 10;
		x2 -= 10;
	}

	//pink
    stroke(246, 159, 255);
    x1 = 400
	y1 = 0
	x2 = 0
	y2 = 0
	for (i = 0; i < 81; i ++) {
		line(x1, y1, x2, y2);
		x1 -= 5;
		y2 += 5;
	}
	//green
	stroke(27,178, 141);
	x1 = 400;
	y1 = 0;
	x2 = 400;
	y2 = 300;
	for (i = 0; i < 81; i ++) {
		line(x1, y1, x2, y2);
		y1 += 5;
		x2 -= 5;
	}
	//yellow
	stroke(232, 214, 114);
	x1 = 0;
	y1 = 0;
	x2 = 0;
	y2 = 300;
	for (i = 0; i < 81; i ++) {
		line(x1, y1, x2, y2);
		y1 += 5;
		x2 += 5;
	}
	//blue
	stroke(150, 173, 255);
	x1 = 400
	y1 = 300
	x2 = 400
	y2 = 0
	for (i = 0; i < 81; i ++) {
		line(x1, y1, x2, y2);
		y1 -= 5;
		x2 -= 5;
	}


}

I wanted to create an abstract version of the sunsets I often see back home in LA. Because of the pollution that surrounds the city, the sunsets that overlooks the city is very colorful.

Leave a Reply