Project 05: Wallpaper

sketchDownload
function setup() {
    createCanvas(600, 400);
    background(250, 220, 137);
}

function draw() {  
    noStroke();
    for(i = -1; i < 3; i++) {
        fill(250, 162, 137);
        rect(70 + i * 210, 0, 50, 400);
        for(j = 0; j < 2; j++) {
            fill(202, 227, 152);
            arc(200 + i * 210, 70 + j * 250 - (i % 2) * 50, 140, 120, radians(80), radians(250));
            fill(250, 220, 137);
            arc(210 + i * 210, 70 + j * 250 - (i % 2) * 50, 140, 120, radians(80), radians(250));
            fill(204, 112, 138);
            circle(200 + i * 210, 45 + j * 250 - (i % 2) * 50, 17);
            circle(213 + i * 210, 55 + j * 250 - (i % 2) * 50, 17);
            circle(213 + i * 210, 70 + j * 250 - (i % 2) * 50, 17);
            circle(200 + i * 210, 75 + j * 250 - (i % 2) * 50, 17);
            circle(187 + i * 210, 55 + j * 250 - (i % 2) * 50, 17);
            circle(187 + i * 210, 69 + j * 250 - (i % 2) * 50, 17);
            fill(209, 158, 71);
            circle(200 + i * 210, 61 + j * 250 - (i % 2) * 50, 20);
            circle(165 + i * 210, 90 + j * 250 - (i % 2) * 50, 18);
            circle(180 + i * 210, 105 + j * 250 - (i % 2) * 50, 12);
        }
        for(j = 0; j < 2; j++) {
            fill(202, 227, 152);
            arc(200 + i * 210, 200 + j * 250 - (i % 2) * 50, 140, 120, radians(280), radians(100));
            fill(250, 220, 137);
            arc(190 + i * 210, 200 + j * 250 - (i % 2) * 50, 140, 120, radians(280), radians(100));
            fill(204, 112, 138);
            circle(200 + i * 210, 175 + j * 250 - (i % 2) * 50, 17);
            circle(213 + i * 210, 185 + j * 250 - (i % 2) * 50, 17);
            circle(213 + i * 210, 200 + j * 250 - (i % 2) * 50, 17);
            circle(200 + i * 210, 205 + j * 250 - (i % 2) * 50, 17);
            circle(187 + i * 210, 185 + j * 250 - (i % 2) * 50, 17);
            circle(187 + i * 210, 199 + j * 250 - (i % 2) * 50, 17);
            fill(209, 158, 71);
            circle(200 + i * 210, 191 + j * 250 - (i % 2) * 50, 20);
            circle(230 + i * 210, 220 + j * 250 - (i % 2) * 50, 18);
            circle(215 + i * 210, 235 + j * 250 - (i % 2) * 50, 12);
        }

    }
    noLoop();
}

This project was very difficult, yet I enjoyed making a repetitive 2D design. I originally made it on Adobe Illustrator to get an idea of what I wanted, and the final outcome is very similar to what I wanted it to be. I used three different for loops for the rectangles and the two different columns of flowers.

Project 05: Wallpaper

sketch

I thought this project was pretty fun! I approached it almost like making a singular tile and then repeating that to create the pattern.

//Jacky Lococo
//jlococo
//section C
function setup() {
    createCanvas(500, 500);
    background(220);
    rectMode(CENTER) 
}

function draw() {
    for(var y = 125/4; y <= height-25; y += 62.5){  //columns made from tile function
        for (var x = 125/4; x <= width-25; x += 62.5){ //rows for tile fuction
        tile (x, y)
    } 
    }

}

function tile (x,y){
    push();
    translate(x,y)

    //main square for the tile -- contains quarter arcs that will make a semi cirlce when repeated
    strokeWeight(0)
    fill(255, 247, 243)
    rect(x, y, 125, 125)

    //black circle within the horizontal cirlce
    strokeWeight(0)
    fill(0)
    ellipse(x+25, y+10, 23, 23)

    //horizontal arc
    strokeWeight(0);
    fill(242, 0, 0)
    arc(x+25, y+10, 75, 75, 0, PI+ TWO_PI, CHORD)


    //3 lines coming from the horizontal arc
    strokeWeight(1)
    line(x + 25, y+10, x-25, y-62.5)
    line(x - 12.5, y+10, x-61, y-62.5)
    line(x + 5, y+10, x -43, y-62.5)

    //bottom left quarter arc to make verticle arc
    strokeWeight(0);
    fill(242, 0, 0)
    arc(x-24, y+62.5, 75, 75, PI, PI*3/2, PIE)

    //top left quarter arc to make verticle arc
    strokeWeight(0);
    fill(242, 0, 0)
    arc(x-24, y-62.5, 75, 75, PI/2, PI, PIE)

    //single left to right line
    strokeWeight(1)
    line(x-24, y+50, x+62.5, y-62.5)

    //small black arc in the middle of the verticle arc -- only shown half of ellipse 
    strokeWeight(0)
    fill(0)
    ellipse(x-24, y+62.5, 25, 25)

    //tan colored arc at the top right of the tile
    strokeWeight(0);
    fill(255, 247, 243)
    arc(x-24, y-62.5, 25, 25, PI/2, PI, PIE)

    //two small dots on top of each other -- sitting below horizontal arc
    strokeWeight(0);
    fill(0)
    ellipse(x+25, y+55, 5, 5)
    strokeWeight(0);
    fill(0)
    ellipse(x+25, y-55, 5, 5)

    pop()
}


Project 5 – Wallpaper

This week’s project asked us to make a wallpaper, so I decided to make my work based on african textiles. Attached is a sketch of my initial idea and my final product. Enjoy!

sketch
var num = 6; //number of itterations of everything

function setup() {
    createCanvas(600, 400);
    background(250, 249, 246);
}

/*let eyeBrown = color(165,42,42);
let bgBrown = color(255, 200, 168);
let branchGreen = color(63, 146, 65);
let turq = color(64,224,208);*/

function drawBackground() {
    //random lines from ex 4 but in for loop
    stroke(255, 200, 168);
    strokeWeight(1);
    for (var y = 0; y < height; y+=20) {
        for (var x = 0; x < width; x+=20) {
            if (random(1) > 0.5) {
              line(x, y, x+20, y+20);
            }
            else {
              line(x, y+20, x+20, y);
            }
        }
    }

    //ornaments
    for (var j = 0; j <= width; j+=width/num) {
        var colors = [color(145,205,211), color(234,204,84)]
        noStroke();
        fill(random(colors));
        circle(random(j, j+(width/num)), random(height/2), random(40,60));
        circle(random(j, j+(width/num)), random(height/2,height), random(40,60));

        push();
        fill(200,74,55);
        translate(random(j,j+(width/num)), random(height));
        for (var r = 10; r < 60; r+=10) {
            for (var i = 0; i < 360; i+=30) {
                push();
                scale(0.3);
                circle(r*cos(radians(i)), r*sin(radians(i)), r/3);
                pop();
            }
        }
        pop();
    }



}

function drawEye(a, b, side) {
    push();
    translate(a, b);

    //alternates side of branch
    if (side == 1) {
        rotate(degrees(-.009));
    } else if (side == -1) {
        rotate(degrees(.009));
    }


//eye arcs
    //blue filling
    push();
        scale(0.7);
        noFill();
        strokeWeight(10);
        stroke(52,173,193);
        arc(0, -45, 100, 100, radians(65), radians(180-65));
        push();
            rotate(radians(180));
            arc(0, -45, 100, 100, radians(65), radians(180-65));
            pop();
    pop();

    //green arcs
    strokeWeight(3);
    noFill();
    stroke(50, 118, 112);
    arc(0, -45, 100, 100, radians(65), radians(180-65));
    push();
        rotate(radians(180));
        arc(0, -45, 100, 100, radians(65), radians(180-65));
    pop();

    //gold arcs
    push();
        scale(0.9);
        noFill();
        strokeWeight(2);
        stroke(234,178,57);
        arc(0, -45, 100, 100, radians(65), radians(180-65));
        push();
            rotate(radians(180));
            arc(0, -45, 100, 100, radians(65), radians(180-65));
            pop();
    pop();

    fill(165,42,42);
    noStroke();
    circle(0, 0, 10); //eyeball

    //lashes
    strokeWeight(1);
    push();
    translate(0, 45);
    rotate(radians(-35));

    stroke(0);
    for (var i = 0; i <= 50; i+=10) {
        rotate(radians(10));
        line(0, -52, 0, -54);
    }

    pop();
    pop();
}

function drawBranches() {
    stroke(63, 146, 65);
    for (var x = 0; x <= width; x+= width/num) {
        push();
        translate(x, random(-50,50));

        var side = 1;
        for (var y = -100; y < height+100; y += 1) {
            //draw alternating eyes
            if ((y%50) == 0 & side == 1) {
                drawEye(cosy+19,y-10,side);
                side = -1*side;
            } else if ((y%50) == 0 & side == -1){
                drawEye(cosy-19,y-10,side);
                side = -1*side;
            }

            //draw branches (vertical cosine curves)
            var cosy = 40-30 * cos(radians(y));

            stroke(50, 118, 112);
            strokeWeight(5);
            point(cosy, y);
        }
        pop();
    }

}

var count = 0;

function draw() {
    drawBackground();

    drawBranches();

    noLoop();
}

Project-05: Wallpaper

I applied the same coding structure I used in my assignment A to this project. Then, I changed the repeated shapes from Hexagon to my designed shapes 1 and 2. Because of the assignment A, it is relatively easy to create this wallpaper pattern.

project05: wallpaperDownload
var x;
var y;
var a=20;
var b=20;



function setup() {
    createCanvas(400, 300);
    background( 240,230,140);
}

//shape in the first column
function shape1(){
    push();
    translate(a,b);
    noStroke();
    x=0;
    y=0;
    var s = 10;
    if(color==1){
        fill(255);
        circle(x,y,s);
        fill(175,238,238);
        circle(x,y+5,s);
        color+=1;
    }
    else{
        fill(175,238,238);
        circle(x,y,s);
        fill(255);
        circle(x,y+5,s);
        color=1;
    }
    
    pop();
}
//shape in the second column
function shape2(){
    push();
    translate(a,b);

    x=0;
    y=0;
    var d=5;
    strokeWeight(2);
    stroke(139,69,19);
    line(x-d,y,x,y-10);
    line(x+d,y,x,y-10);
    noStroke();
    fill(255,69,0);
    circle(x-d,y,10);
    circle(x+d,y,10);
    pop();
}

function draw() {
    //two circles
    for(b=20; b<=400; b +=50){
        for(a=20; a<=500; a+=50){
            shape1();
        }
    }

    //cherry shape
    
    for(b=50; b<=250; b +=50){
        for(a=45; a<=350; a+=50){
            shape2();
        }
    }


}

Wallpaper

sketchDownload

function setup() {
    createCanvas(400, 600);
    background(182, 217, 214);
}

function draw() {
    noStroke();
    for (let i = 0; i < 4; i++) {
        for (let j = 0; j < 6; j++) {
          fill(140, 110, 60);
          square(20+(i*100), 60+(j*100), 30);
          rect(20+(i*100), 20+(j*100), 5, 40);
          triangle(20+(i*100), 60+(j*100), 50+(i*100), 60+(j*100), 50+(i*100), 40+(j*100));
          circle(55+(i*100), 45+(j*100), 30);
          triangle(40+(i*100), 45+(j*100), 50+(i*100), 20+(j*100), 55+(i*100), 45+(j*100));
          triangle(70+(i*100), 45+(j*100), 60+(i*100), 20+(j*100), 55+(i*100), 45+(j*100));
          fill(255, 222, 33);
          ellipse(50+(i*100), 45+(j*100), 5, 10);
          ellipse(60+(i*100), 45+(j*100), 5, 10);
          fill(56, 83, 130);
          ellipse(70+(i*100), 80+(j*100), 25, 10);
          triangle(80+(i*100), 80+(j*100), 90+(i*100), 70+(j*100), 90+(i*100), 90+(j*100));
        }
    }
    noLoop();
}

I knew immediately that I wanted to do a cat patterned wallpaper. First I tried to break down what shapes I needed to represent a cat. Everything went well and I was able to draw it with p5js. I felt like it was missing something, so I added a fish for the cat to snack on. Once I drew the first cat and fish combo, put it in a nested for loop and changed the coordinates for each iteration. This quickly drew all of my cats for the complete wallpaper.

Wallpaper Project

sketchDownload

/*
Yanina Shavialenka
Section B
yshavial@andrew.cmu.edu
Project 5: Wallpaper
*/

var x = 100;
var y = 45;
var s = 8;

var xS1 = 193;
var yS1 = 60;
var xS2 = 193;
var yS2 = 115;


function setup() {
  createCanvas(600, 600);
  background(0, 0, 51);
  text("p5.js vers 0.9.0 test.", 10, 15);
} 

function draw() { 
    background(0, 0, 51);
    
    //Hexagonal background
    for(var xH = 0; xH <= 600; xH += 15){
        for (var yH = 0; yH <= 600; yH += 2*s*sqrt(3)/2){
            fill(0, 0, 51);
            hexagon(xH, yH);
        }
    }
    for (var xH = 10; xH <= 600; xH += 15){
        for (var yH = s*sqrt(3)/2; yH <= 600; yH += 2*s*sqrt(3)/2){
            fill(0, 0, 95)
            hexagon(xH, yH);
        }
    }


    //Solar Systems
    for(x = 100; x <= width; x += 200){
        for(y = 85; y <=height; y += 300){
            solarSystem();
        }
    }
    for(x = 0; x <= width; x += 200){
        for(y = 235; y <= height; y += 300){
            solarSystem();
        }
    }

    //Yellow Stars
    for(xS1 = -7; xS1 <= width; xS1 += 200){
        for(yS1 = 45; yS1 <=height; yS1 += 300){
            star();
        }
    }
    for(xS1 = 93; xS1 <= width; xS1 += 200){
        for(yS1 = 195; yS1 <= height; yS1 += 300){
            star();
        }
    }

    //Pink Stars
     for(xS2 = -7; xS2 <= width; xS2 += 200){
        for(yS2 = 115; yS2 <=height; yS2 += 300){
            star();
        }
    }
    for(xS2 = 93; xS2 <= width; xS2 += 200){
        for(yS2 = 265; yS2 <= height; yS2 += 300){
            star();
        }
    }
}

function star() {
    /*
    This function draws yellow and pink stars.
    The star is made out of a square in the middle and 4
    triangles that surround that square.
    */

    //Yellow Star
    noStroke();
    fill(255, 255, 102);
    rect(xS1, yS1, 13, 13);
    triangle(xS1, yS1, xS1+6.5, yS1-13, xS1+13, yS1);
    triangle(xS1, yS1, xS1-13, yS1+6.5, xS1, yS1+13);
    triangle(xS1, yS1+13, xS1+6.5, yS1+26, xS1+13, yS1+13);
    triangle(xS1+13, yS1, xS1+26, yS1+6.5, xS1+13, yS1+13);

    //Pink Star
    noStroke();
    fill(255, 178, 153);
    rect(xS2, yS2, 13, 13);
    triangle(xS2, yS2, xS2+6.5, yS2-13, xS2+13, yS2);
    triangle(xS2, yS2, xS2-13, yS2+6.5, xS2, yS2+13);
    triangle(xS2, yS2+13, xS2+6.5, yS2+26, xS2+13, yS2+13);
    triangle(xS2+13, yS2, xS2+26, yS2+6.5, xS2+13, yS2+13);
}

function solarSystem() {
    /*
    This function draws Solar System with sun in the middle
    and planets rotating around the sun on their orbits.
    */
    
    //Orbits
    stroke(255);
    fill(0, 0, 0, 0);
    ellipse(x, y, 25, 25);
    ellipse(x, y, 45, 45);
    ellipse(x, y, 65, 65);

    push();
    strokeWeight(3);
    stroke(180);
    ellipse(x, y, 85, 85);
    pop();
    ellipse(x, y, 105, 105);

    ellipse(x, y, 125, 125);
    ellipse(x, y, 145, 145);
    ellipse(x, y, 165, 165);


    //Sun
    noStroke();
    fill(255, 255, 0);
    ellipse(x, y, 12, 12);

    //Venus
    noStroke();
    fill(160, 160, 160);
    ellipse(x+8, y+10, 8, 8);

    //Earth
    noStroke();
    fill(0, 102, 204);
    ellipse(x+10, y-20, 13, 13);
    fill(0,220,0);
    ellipse(x+11, y-22, 8, 4);
    ellipse(x+11, y-17, 4, 2.5);
    ellipse(x+7, y-19, 5, 2);

    //Mars
    noStroke();
    fill(204, 65, 0);
    ellipse(x-30, y-10, 12, 12);

    //Jupiter
    noStroke();
    fill(255, 155, 0);
    ellipse(x+40, y+35, 18, 18);
    stroke(195, 0, 0);
    line(x+35, y+28, x+48, y+34);
    stroke(205, 50, 0);
    line(x+32, y+33, x+46, y+40);

    //Saturn
    stroke(255);
    fill(0, 0, 0, 0);
    ellipse(x+37, y-50, 30, 9);
    noStroke();
    fill(190, 190, 190);
    ellipse(x+37, y-50, 16.5, 16.5);

    //Uranus
    noStroke();
    fill(153, 204, 255);
    ellipse(x-53, y+50, 15, 15);

    //Neptune
    noStroke();
    fill(10, 76, 153);
    ellipse(x-45, y-70, 15, 15);
}


function hexagon(xH,yH){
    /*
    This function draws one hexagon with a side of 8 pixels 
    that is made out of 8 triangles.
    */
    push();
    translate(xH,yH)
    noStroke();
    triangle(0,0,-s,0,-s/2,-s*sqrt(3)/2)
    triangle(0,0,-s/2,-s*sqrt(3)/2,s/2,-s*sqrt(3)/2)
    triangle(0,0,s,0,s/2,-s*sqrt(3)/2)
    triangle(0,0,-s,0,-s/2,s*sqrt(3)/2)
    triangle(0,0,-s/2,s*sqrt(3)/2,s/2,s*sqrt(3)/2)
    triangle(0,0,s,0,s/2,s*sqrt(3)/2)
    pop();
}



|

This project was very interesting in the fact that I get to design whatever I want which also made this project hard as if it was hard to stop on one idea only. I came up with the idea of Solar system with planets surrounding a sun in the middle. All of the systems are identical and are separated by yellow and pink stars.

Project 05 Wallpaper

sketch

//Tim Nelson-Pyne
//tnelsonp@andrew.cmu.edu
//Section C
//Project-05-Wallpaper


//controls the spacing of the pattern
var cellSize;
//controls the width of the eyes
var eyeWidth;
//controls the height of the eyes
var eyeHeight;
//controls the x position of the patten elements
var x;
//controls the y position of the pattern elements
var y;

function setup() {
    createCanvas(600, 600);
    background(255);
    cellSize = width / 4
}


//tileA draws everything to do with the eyes

function tileA(x, y, cellSize) {

    eyeHeight = cellSize / 7;
    eyeWidth = cellSize / 4;

    //clown makeup
    
    stroke(248, 24, 148);
    fill(255, 204, 239);
    strokeWeight(4);
    bezier(x + eyeWidth / 4, y + eyeHeight + 5, x, y + eyeHeight + 5, x, y + eyeHeight + 5, x, y + cellSize / 2 - 10);
    bezier(x - eyeWidth / 4, y + eyeHeight + 5, x, y + eyeHeight + 5, x, y + eyeHeight + 5, x, y + cellSize / 2 - 10);
    bezier(x + eyeWidth / 4, y - eyeHeight - 5, x, y - eyeHeight - 5, x, y - eyeHeight - 5, x, y - cellSize / 2 + 10);
    bezier(x - eyeWidth / 4, y - eyeHeight - 5, x, y - eyeHeight - 5, x, y - eyeHeight - 5, x, y - cellSize / 2 + 10);
    //eye shadow
    for (i = 0; i < 20; i += 1) {
        noFill();
        strokeWeight(.5);
        stroke(248, map(i, 0, 20, 24, 255), map(i, 0, 20, 148, 255));
        ellipse(x, y, eyeWidth + i, eyeHeight + i);
    }

    // eye
    fill(255);
    strokeWeight(3);
    stroke(245, 230, 0);
    ellipse(x, y, eyeWidth, eyeHeight);
    fill(0, 0, 255);
    ellipse(x, y, 20, eyeHeight);
    fill(255);
    noStroke();
    arc(x, y, 20, eyeHeight, radians(220), radians(250))

}

//tileB draws the mouth
function tileB(x, y, cellSize) {
    noFill();
    strokeWeight(5);
    stroke(248, 24, 148);
    arc(x, y, cellSize / 3, cellSize / 10 + 10, radians(0), radians(180));
    arc(x, y, cellSize / 3, cellSize / 10, radians(0), radians(180));
}

//tileC draws the nose
function tileC(x, y, cellSize) {
    fill(248, 24, 148);
    noStroke();
    ellipse(x, y - cellSize / 4, cellSize / 4, cellSize / 4);
    fill(255, 204, 239);
    ellipse(x, y - cellSize / 4, cellSize / 5, cellSize / 5);
}

function draw() {
    for (x = cellSize / 2; x < width; x += cellSize){
        for (y = cellSize / 2; y < height; y += cellSize){
            tileA(x, y, cellSize);
        }
    }
    for (x = cellSize; x < width; x += cellSize){
        for (y = cellSize; y < height; y += cellSize){
            tileB(x, y, cellSize);
            tileC(x, y, cellSize);

        }
    }
    noLoop();

}

I made a clown face wallpaper. The walls have eyes, and they’re clowning you.

Project-05: Wallpaper

My Work

//cbtruong;
//Section B;

function setup() {
    createCanvas(600, 600);
    //cream background color that goes with the wallpaper-esque idea;
    background(248, 241, 196);
    text("p5.js vers 0.9.0 test.", 10, 15);
}

function draw() {
    background(248, 241, 196);
    //two for loops to draw repeated versions of pattern 1;
    //inner loop is the x coordinate while the outer is the y coordinate;
    //both i and j are initialized as width/height /4 to allow for centering;
    for (var j = height/4; j < height*2; j += 300){
        for (var i = width/4; i < width*2; i += 300){
            pattern1(i, j);
        }
    }
    //two for loops to draw repeated versions of pattern 2;
    //inner loop is the x coordinate while the outer is the y coordinate;
    //both l and m are intialized as width/height /2 to allow for centering;
    //between pattern 1;
    for (var m = height/2; m < height*2; m += 300){
        for (var l = width/2; l < width*2; l += 300){
            pattern2(l, m);
        }

    }
}


function pattern1 (x, y) {
    //scaled it down by 0.5 by encasing;
    //the entire pattern in a push/pop;
    push();

    scale(0.5);
    strokeWeight(1);
    noFill();
    //connecting lines;
    line(x, y, x - 50, y);
    line(x, y, x + 50, y);
    curve(x + 50, y, x - 50, y, x - 50, y - 50, x + 50 , y);
    curve(x - 50, y, x + 50, y, x + 50, y + 50, x - 50, y);
    //white circle;
    fill(255);
    circle(x, y, 15);
    //muted blue color rectangle;
    fill(92, 143, 191);
    rect(x - 50, y - 70, 20, 40);
    //muted red color rectangle;
    fill(182, 30, 40);
    rect(x + 30, y + 30, 20, 40);
    //reddish lines;
    fill(196, 59, 62);
    strokeWeight(4);
    line(x - 40, y - 10, x - 5, y - 40);
    line(x - 35, y - 5, x, y - 35);
    line(x + 5, y + 40, x + 40, y + 10);
    line(x, y + 35, x + 35, y + 5);
    //muted green triangles;
    strokeWeight(1);
    fill(62, 167, 32);
    triangle(x + 45, y + 50, x + 25, y + 70, x - 15, y + 60);
    triangle(x - 45, y - 50, x - 25, y - 70, x + 15, y - 60);
    //second set of connecting lines;
    line(x, y, y - 40, y + 40);
    line(x, y, y + 40, y - 40);
    noFill();
    curve(x, y, x - 40, y + 40, x - 50, y, x, y);
    curve(x, y, x + 40, y - 40, x + 50, y, x, y);
    //yellow ellipse tilted using push/pop;
    push();
    translate(x - 30, y + 50);
    rotate(radians(45));
    fill(217, 227, 10);
    ellipse(0, 0, 20, 50);
    pop();
    //orange ellipse tilted using push/pop;
    push();
    translate(x + 30, y - 50);
    rotate(radians(45));
    fill(226, 160, 29);
    ellipse(0, 0, 20, 50);
    pop();

    pop();
    noLoop();
}

function pattern2 (x, y){
    //scaled it down by 0.5 as well;
    //also encased it in a push/pop to allow scaling;
    push();
    scale(0.5);

    //draws aquamarine rectangle;
    fill(69, 166, 159);
    rectMode(CENTER);
    rect(x, y, 30, 30);
    //draws connecting lines;
    line(x - 20, y + 15, x - 35, y + 35);
    line(x + 20, y - 15, x + 35, y - 35);
    line(x + 35, y - 35, x - 15, y - 35);
    line(x - 35, y + 35, x + 15, y + 35);
    line(x - 20, y + 15, x - 20, y - 15);
    line(x + 20, y - 15, x + 20, y + 15);
    //draws muted pink circles;
    fill(153, 139, 102);
    circle(x - 35, y - 35, 40);
    circle(x + 35, y + 35, 40);
    //draws muted reddish triangles;
    fill(196, 59, 62);
    triangle(x - 20, y - 15, x - 30, y + 20, x - 60, y);
    triangle(x + 20, y + 15, x + 30, y - 20, x + 60, y);
    //draws tilted muted yellow rectangles;
    fill(187, 164, 91);
    push();
    translate(x - 10, y + 40);
    rotate(radians(315));
    rect(0, 0, 20, 30);
    pop();
    push();
    translate(x + 10, y - 40);
    rotate(radians(315));
    rect(0, 0, 20, 30);
    pop();

    pop();
}

I based it off of the early 20th Century Russian Art Movement known as Suprematism. I had the most fun so far creating this Program. Overall, it is very simple in terms of its creation. I just used pre-defined shapes and muted colors. I also used push/pop transformations to angle somethings and to make the main two patterns fit better on the 600×600 canvas.

Project 5: Wallpaper

var s = 50;
function hexagon(xCenter,yCenter,color,col) {

    var canvas = document.getElementById('hexagons');
    var ctx = canvas.getContext('2d');
    
    ctx.beginPath();

    ctx.moveTo(xCenter - s, yCenter);
    ctx.lineTo(xCenter - (s/2), yCenter - s*Math.sqrt(3)/2);
    ctx.lineTo(xCenter + (s/2), yCenter - s*Math.sqrt(3)/2);
    ctx.lineTo(xCenter + s, yCenter);
    ctx.lineTo(xCenter + (s/2), yCenter + s*Math.sqrt(3)/2);
    ctx.lineTo(xCenter - (s/2), yCenter + s*Math.sqrt(3)/2);
    ctx.lineTo(xCenter - s, yCenter);

    ctx.closePath();
    ctx.stroke();
    if (col) {
        if (color % 3 == 1) {
            ctx.fillStyle = '#f00';
        } else if (color % 3 == 2) {
            ctx.fillStyle = '#0f0';
        } else {
            ctx.fillStyle = '#00f';
        }
    } else {
        if (color % 3 == 1) {
            ctx.fillStyle = '#00f';
        } else if (color % 3 == 2) {
            ctx.fillStyle = '#f00';
        } else {
            ctx.fillStyle = '#0f0';
        }
    }
    
    ctx.fill();
}

function draw() {

    var above = true;
    for (var i = 1; i <= 6; i++) {

        for (var j = 1; j <= 5; j++) {
            hexagon(150 * j - 100, (25 * Math.sqrt(3) * 2 * i),i,true);
        }
        
    }

    for (var i = 1; i <= 5; i++) {

        for (var j = 1; j <= 4; j++) {

        hexagon(150 * j - 25,(25 * Math.sqrt(3) * 2 * i) + 25 * Math.sqrt(3),i,false);
        }
    }

}
draw();