Margot Gersing – Project 05 – Wallpaper

mgersing-project5

// Margot Gersing - Project 5 - Section E - mgersing@andrew.cmu.edu

function setup() {
    createCanvas(600,600);

}

function draw(){
	background(249, 209, 99);

	// blue
	for (var y = height/24; y < height; y += height/6) {
        for (var x = width/24; x < width; x += width/6) {
            fill(61, 93, 112);
            noStroke();
            rect(x + 17.5, y, 15, 50);
            rect(x, y + 17.5, 50, 15);
        }
    }

    // red +
    for (var y = 0; y < height + height/6; y += height/6) {
        for (var x = 0; x < width + width/6; x += width/6) {
            fill(213, 85, 39);
            noStroke();
            rect(x - 7.5, y, 15, 50);
            rect(x - 25, y + 17.5, 50, 15);
        }
    }

    // green shape
    for (var y = 0; y < height + height/6; y += height/6) {
        for (var x = 25; x < width + width/6; x += width/6) {
            fill(139, 163, 126);
            noStroke();
            rect(x, y - 25, 5, 25);
            rect(x, y, 25, 5);
        }
    }

    // gray shape
    for (var y = 75; y < height + height/6; y += height/6) {
        for (var x = 75; x < width + width/6; x += width/6) {
            fill(50);
            noStroke();
            rect(x, y, 5, 25);
            rect(x, y, 25, 5);
        }
    }

    // white horizontal dots
    for (var y = 0; y < height + height/6; y += height/6) {
        for (var x = width/12; x < width + width/6; x += width/6) {
            fill(255);
            ellipse(x, y + 15, 5, 5);
            ellipse(x - 15, y + 15, 5, 5);
            ellipse(x + 15, y + 15, 5, 5);
          
        }
    }

    // white vertical dots
    for (var y = height/12; y < height + height/6; y += height/6) {
        for (var x = 0; x < width + width/6; x += width/6) {
            ellipse(x + 15, y, 5, 5);
            ellipse(x + 15, y + 15, 5, 5);
            ellipse(x + 15, y + 30, 5, 5);
            
          
        }
    }

}

For this project I wanted to create a geometric pattern. I also wanted to use festive colors. It was fun to make a playful pattern from simple shapes.

Leave a Reply