art deco ish?

i struggled quite a bit with keeping my variables in check without rotating absolutely everything chaotically. to deal with this, I ended up hard-coding too many numbers…

sketch
// jaden luscher
// jluscher
// section a
// project 05

// this program draws an art deco-influenced wallpaper

// initializing variables
var tileSize = 30;

// random color variables
var stemColor;
var budColor;
var frondColor;

function setup() {
    createCanvas(450, 650);
    background("#7F246B");    // fuschia
    angleMode(DEGREES);
    rectMode(CENTER);
    noLoop();

    stemColor = "#E09D00";  // ochre
    budColor = "#FFD470";   //light yellow
    frondColor = "#033B63";   // dark blue
}

function draw() {
  for(var i = 0; i < 5; i++) {
    drawBand();
    translate(-3.21*tileSize, 3*tileSize);
  }
}


function drawBand() {
  translate(tileSize, 3*tileSize);   // temporary, just to see tile in center
  for(var k = 0; k < height/(3*tileSize); k++) {
    for(var j = 0; j < width/(tileSize); j++) {
      oneTile();
      rotate(180);
      translate (2.15*tileSize, tileSize/10);
      // I cant figure out why the row slants if i dont move it
      // vertically by the arbitrary number tileSize/10 :-(
    }
    translate(-3.21*tileSize, tileSize);
    rotate(180);
  }
  print(height/ (6*tileSize));
}


function oneTile() {
  flowerStem();
  push();
  noStroke();
  // draw 2 fronds
  translate(0,-tileSize/10);  //bottom of fronds align to triangle edge
  rotate(-90);
  frond(tileSize);  // right frond
  rotate(-90);
  frond(tileSize);  //left frond

  fill(budColor);
  ellipse(0, 0, tileSize/3, tileSize*1.5)
  pop();
}


function flowerStem() {
  // rotate(180);
  fill(stemColor);
  stroke(stemColor);
  triangle(0, -tileSize, -tileSize, 0, tileSize, 0);    // triangle base
  arc(0, -1.5*tileSize, tileSize, tileSize, -135, -45, PIE);    // flower base
  strokeWeight(2);
  line(0, -tileSize, 0, -1.5*tileSize); // stem


  // stamen
  push();
  translate(0, -1.5*tileSize);
  rotate(45);   // align stamen lines with base of flower arc
  fill(budColor);
  var numStamen = tileSize/2;
  var angle = 90/numStamen;
  for(var i=0; i <= numStamen; i++) {
    strokeWeight(0.5);
    line (0, 0, 0, -tileSize);
    push();
    noStroke();
    ellipse(0, -tileSize, tileSize/12); // flower buds
    pop();
    rotate(-angle);
  }
  pop();


}

function frond(tileSize) {
  fill(frondColor);
  push();
  var x = 0;
  var y = 0;
  var leafSize = tileSize/7;  // width of leaf. /6 creates woven pattern, /8 is more leaf-like
  var numLeaves = leafSize*2;
  // left half of frond
  push();
  for (var i = 0; i < numLeaves; i++){
    triangle(0, 0, x, -y, x+leafSize, -y);
    rotate(90/numLeaves);
    x += leafSize;
    y += leafSize;
  }
  pop();

  // right half of frond
  push();
  for (var i = 0; i < numLeaves; i++){
    triangle(0, 0, x, y, x+leafSize, y);
    rotate(90/numLeaves);
    x -= leafSize;
    y -= leafSize;
  }
  pop();
}

Project 05-Wallpaper

A wallpaper design inspired by Marimekko Unikko!

sketch
//Angela Yang
//Section C

function setup() {
  createCanvas(600, 700);
  noLoop();
  //frameRate(1);
}

function draw() {
  background("#ddd9c8");
  scale(0.6);
  for (let i = 0; i < 7; i++) {
    for (let j = 0; j < 6; j++) {
      switch (parseInt(random(3))) {
        case 0:
          mikkoflower1(190 * j, 215 * i, color(36, 28, 85));
          break;
        case 1:
          mikkoflower2(190 * j, 215 * i, color(36, random(100), 85));
          break;
        case 2:
          scale(1);
          mikkoflower3(190 * j, 215 * i, color(36, random(100), 85));
          break;
      }
    }
  }

  //Flower 1
  function mikkoflower1(x, y, fillcolor) {
    push();

    // petals
    fill("#b8172a");
    translate(x, y);
    noStroke();
    for (let i = 0; i < 20; i++) {
      ellipse(15, 10, 90, 5);
      // ellipse(0, 50, 30, 60);
      ellipse(0, 0, 20, 90);
      scale(1.02);
      rotate(radians(60));
    }

    // center
    fill("#ddd9c8");
    ellipse(1, 3, 50, 70);
    ellipse(2, 5, 60, 70);
    fill(fillcolor);
    rect(-8, -10, 25, 25);

    pop();
  }

  //Flower 2
  function mikkoflower2(x, y, fillcolor) {
    push();

    // petals
    fill(fillcolor);
    translate(x, y);
    noStroke();
    for (let i = 0; i < 20; i++) {
      ellipse(0, 8, 70, 10);
      ellipse(20, 50, 40, 90);
      ellipse(0, 0, 20, 100);
      rotate(radians(150));
    }

    // center
    fill("#ddd9c8");
    ellipse(1, 3, 50, 70);
    ellipse(2, 5, 60, 70);
    fill(fillcolor);
    ellipse(2, 5, 25, 40);

    // // stem
    // rotate(radians(80));
    // strokeWeight(10);
    // stroke(fillcolor);
    // line(30, 90, 55, 150);
    pop();
  }

  //Flower 3
  function mikkoflower3(x, y, fillcolor) {
    push();

    // petals
    fill(fillcolor);
    translate(x, y);
    noStroke();
    for (let i = 0; i < 20; i++) {
      ellipse(15, 10, 100, 80);
      ellipse(0, 50, 40, 90);
      ellipse(20, 0, 20, 100);
      rotate(radians(230));
      scale(1.01);
    }

    // center
    fill("#ddd9c8");
    ellipse(1, 3, 50, 70);
    ellipse(2, 5, 60, 70);
    fill(fillcolor);
    ellipse(2, 5, 30, 40);

    //     // // stem
    //     rotate(radians(80));
    //     strokeWeight(15);
    //     stroke(fillcolor);
    //     line(30, 90, 55, 150);
    pop();
  }
}

Project 5: Wallpaper, Section B

Flower of Life Wallpaper

Sketch
/* Evan Stuhlfire
** estuhlfi@andrew.cmu.edu, section B
** Project 05: Wallpaper */

var dot = 5;
var bigDot = 10;

function setup() {
    createCanvas(600, 400);
    background(224, 223, 214);
    rectMode(CENTER);
}

function draw() {
    var rowHeight = 150;
    var colCount = 1; 
    var circleDiam = 50;
    var circleOffset = 10;
    var cosAmplitude = 40; // height of cos wave
    var sinAmplitude = 60; // height of sin wave
    var sinInc = 5; // increase for sin offset

    // Iterate over row to create rows of sin and cos waves
    for(var row = 0; row < height + rowHeight; row += rowHeight) {
        var colCounter = 0; // reset column counter for new row

        // iterate over theta to draw cos waves in background
        for(var theta = 0; theta < width; theta++) {
            stroke(49, 54, 56, 45);
            circle(theta, row + cosAmplitude * cos(radians(theta)), .2);
            circle(theta, row + cosAmplitude * -cos(radians(theta)), .2);
        }

        // iterate over theta to draw sin waves
        for(var theta = 0; theta < width + circleDiam; theta++) {
            stroke(49, 54, 56, 70);
            fill(49, 54, 56, 70);
            // draw sin waves as circles as theta moves across canvas
            // increment the sinAmplitude to create layered affect
            // decrease diam of circles to decrease line weight
            circle(theta, row + sinAmplitude * sin(radians(theta)), 2);
            circle(theta, row + (sinAmplitude + sinInc) * 
                sin(radians(theta)), 1);
            circle(theta, row + (sinAmplitude + 2 * sinInc) * 
                sin(radians(theta)), .2);
            circle(theta, row + sinAmplitude * -sin(radians(theta)), 2);
            circle(theta, row + (sinAmplitude + sinInc) * 
                -sin(radians(theta)), 1);
            circle(theta, row + (sinAmplitude + 2 * sinInc) * 
                -sin(radians(theta)), .2);

            // every 90 degrees draw a design
            if(theta % 90 == 0) {
                colCounter++;
                // when inside the sin waves draw circle of life
                if(colCounter % 2 == 0) {
                    stroke(49, 54, 56, 175);
                    fill(224, 223, 214);
                    drawLife(theta, row);
                } else {
                    // draw ellipses at intersection of sin waves
                    stroke(49, 54, 56, 50);
                    fill(224, 223, 214);
                    // draws concentric ellipses
                    for(var i = circleDiam; i >= 15; i -= 15){
                        ellipse(theta, row, i + circleOffset, i);
                    }
                    fill(49, 54, 56, 140);
                    ellipse(theta, row, bigDot); // draw dots at intersections

                    // draw little flowers
                    drawLittleFlowers(theta, row);
                } 
            }
        }
    }
    noLoop();
}

function drawLife(theta, row) {
    // draw the circle of life
    // set variable for circle dimensions and offset angles
    var bigDiam = 110;
    var diam = 30; // set smaller circle diameter
    var ellipseOffset = 20;
    var rad = diam/2;
    var angle1 = 30;
    var angle2 = 5 * angle1;
    var angle3 = 45;
    var oneEighty = 180;
    var angleOffset = 2;
    var diamOffset = 5;

    push(); // save settings
    translate(theta, row); // reposition origin
    stroke(49, 54, 56, 90); // lighten inner circles
    // draw larger ellipse
    ellipse(0, 0, bigDiam, bigDiam - ellipseOffset);

    // draw center circle
    circle(0, 0, diam);

    noFill();
    // draw layers of circles with drawMoreCircles with 
    // distance from center, diameter, and angle of offset
    // inner layer of circles
    drawMoreCircles(rad, diam, oneEighty/2);
    drawMoreCircles(rad, diam, angle1);
    drawMoreCircles(rad, diam, angle2);

    // second layer of circles
    drawMoreCircles(diam, diam, oneEighty/2);
    drawMoreCircles(diam, diam, angle1);
    drawMoreCircles(diam, diam, angle2);
    drawMoreCircles(diam - diamOffset, diam, oneEighty);
    drawMoreCircles(diam - diamOffset, diam, 0);
    drawMoreCircles(diam - diamOffset, diam, angleOffset * angle1); 
    drawMoreCircles(diam - diamOffset, diam, 2 * angleOffset * angle1);
    
    // third layer of circles
    // adjustments to offset diam and angle
    drawMoreCircles(diam + rad - diamOffset, diam, oneEighty - 
        (5 * angleOffset));
    drawMoreCircles(diam + rad - diamOffset, diam, -5 * angleOffset)

    pop(); // retore settings
    fill(120); // solid grey
    // draw center flower dot
    ellipse(theta, row, dot);
}

function drawMoreCircles(expand, diam, angle) {
    // draw two circles at opposite angles defines by the 
    // distance from the center, diameter, and offset angle
   circle(expand * cos(radians(angle)), expand * sin(radians(angle)), diam);
   if(angle != 180 & angle != 0){
       circle(expand * cos(radians(-angle)), expand * 
        sin(radians(-angle)), diam);
   }
}

function drawLittleFlowers(theta, row) {
    var rowOffset = 75;
    var petalLength = 15;
    var petalWidth = 4;
    var petals = 6;
    var angle = 30;
    var angleIncrease = 60;
    var diam = 30;
    var accentOffset1 = 7;
    var accentOffset2 = 10;
    var ellipseOffset = 10;

    // set color for flower petals
    stroke(49, 54, 56, 100);
    fill(224, 223, 214);

    // draw circle to contain flower
    ellipse(theta, row + rowOffset, diam + ellipseOffset, diam);
    circle(theta, row + rowOffset, diam);
    // draw the petals
    for(var i = 0; i < petals; i++){
        push(); // save settings
        translate(theta, row + rowOffset);
        rotate(radians(angle)); 
        ellipse(petalLength/2, 0, petalLength, petalWidth);

        // draw accent lines with offsets
        line(petalLength + accentOffset1, 0, petalLength + accentOffset2, 0);
        pop(); // restore settings

        angle += angleIncrease;
    }
    // draw the center dot
    fill(120); // solid grey
    ellipse(theta, row + rowOffset, dot);
}

Project 5: Wallpaper

Shirley P5

sketch
//Xinyi Du 
//15104 Section B
//xinyidu@andrew.cmu.edu
//Project-05

var w = 100; 
var h = 100;


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

function draw() {
    background(0, 58, 100);

    for (var col=0; col<3; col++) {
        for (var row=0; row<10; row++) {
            stroke(200, 223, 82); //green
            rotateEllipsee(w+3*w*col, h-100+h*row);
            stroke(221,160,221); //pink
            fill(221-90,160-90,221-90); //pink
            circleLine2(w+3*w*col, h-100+h*row);
        }
    }
    for (var col=0; col<3; col++) {
        for (var row=0; row<10; row++) {
            stroke(221,160,221); //pink
            rotateEllipsee(w+100+3*w*col, 0+h*row);
            stroke(200, 223, 82); //green
            fill(200-90, 223-90, 82-90); //green
            circleLine2(w+100+3*w*col, 0+h*row);   
        }
    }
    for (var col=0; col<3; col++) {
        for (var row=0; row<10; row++) {
            stroke(200, 223, 82); //green
            circless(-20+3*w*col, h/2+h*row);
            stroke(221,160,221); //pink
            circless(20+3*w*col, -50+h/2+h*row);
        }
    }
    
}

//draw the small circles and lines
function circleLine(x, y) {
    strokeWeight(1.5);
    push();
    translate(x, y); 
    line(60/2-5, 0, 60/2+20*sqrt(2), 0); 
    ellipse(60/2+20*sqrt(2)-10/2, 0, 10, 10);
    rotate(radians(25)); //rotate to get the second pair of ellipse and line 25 degrees above
    line(60/2-5, 0, 60/2+20*sqrt(2)-5, 0); 
    ellipse(60/2+20*sqrt(2)-10/2-5, 0, 10, 10);
    rotate(radians(-50)); //rotate to get the third pair of ellipse and line 25 degrees below
    line(60/2-5, 0, 60/2+20*sqrt(2)-5, 0); 
    ellipse(60/2+20*sqrt(2)-10/2-5, 0, 10, 10);
    pop();
}

//draw the ellipses center on (x,y)
function ellipsee(x, y) {
    strokeWeight(1.5);
    //mirror the small circles and lines though rotating them 18 degrees
    circleLine(x, y); 
    push();
    translate(x, y);
    rotate(radians(180));
    circleLine(0, 0);
    pop();

    //white ellipses
    fill(0, 58, 100);
    ellipse(x, y, 60, 39);
    ellipse(x, y, 40, 26);
    ellipse(x, y, 20, 13);
}

//roatate the ellipses drawn in the previous function
function rotateEllipsee(x, y) { 
    fill(0, 58, 100);
    push();
    translate(x, y);
    rotate(radians(-45));//rotate -45 degrees
    ellipsee(0, 0);
    pop();
}

//draw the vertical lines and circles
function circleLine2(x, y) {
    strokeWeight(2);
    //fill(221,160,221);
    line(x, y-w, x, y-w+50);
    line(x, y-w+50, x, y-w+50+h);
    line(x, y-w+50+h, x, y-w+50+h+50);
    ellipse(x, y-w+50, 12);
    ellipse(x, y-w+50+h, 12);
}

//draw the vertical circles
function circless(x, y) {
    strokeWeight(1.5);
    noFill();
    ellipse(x, y, 25);
    ellipse(x, y, 10);
    ellipse(x, y-25, 7);
    ellipse(x, y+25, 7);
    ellipse(x, y-42, 7);
    ellipse(x, y+42, 7);
}

    





Project 05 – Wallpaper

Stereoscopic style wallpaper with randomly generated shapes throughout composition.

sketch
//Aarnav Patel
//Section D
//aarnavp@andrew.cmu.edu
//Project-05

var side = 100;
var radius = 0.8 * side
function setup() {
    createCanvas(600, 600);
    background(0);
}

function draw() {
	noStroke();

	let arr1 = [1, 2, 3];
	count = 0;
	for (var y = 0; y < height; y += side) {
		count = count + 1; 
		for (var x = 0; x < width; x += side) {
			if (count == floor(random(0, 5))) {
				drawTile(x, y);
				drawRandomShape(x, y);
				count = 0;
			} else {
				drawTile(x, y);
			}
		}
	}
	noLoop();
}

function drawTile(x, y) {
	fill(0, 0, 255, 150);
	ellipse(x + side / 2, y + side / 2, radius);
	fill(255, 0, 0, 100);
	ellipse(x + radius / 2, (y + side / 2 ), radius);

	fill(0, 0, 255, 100);
	triangle(x - 5, y - 5, (x + side) - 5, y - 5, x - 5, (y + side) - 5);
	fill(255, 0, 0, 150);
	triangle(x, y, x + side, y, x, y + side);

}

function drawRandomShape(x, y) {
	var r = floor(random(0, 3));
	fill(255);

	if (r == 0) {
		rectMode(CENTER);
		rect(x + (side / 2), y + (side / 2), side * 0.1, side * 0.5);
		rect(x + (side / 2), y + (side / 2), side * 0.5, side * 0.1);
	} else if (r == 1) {
		rectMode(CENTER);
		rect(x + (side / 2), y + (side / 2), side * 0.1, side * 0.5);
	} else {
		rectMode(CENTER);
		rect(x + (side / 2), y + (side / 2), side * 0.5, side * 0.1);
	}
}

Project 05

I made 2 repeating patterns using squares, flower, and arcs 🙂

sketch
// Sowang Kundeling Section C Project 05

var size = 40;

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

function draw() {
    background(82, 30, 49)

    for (var x = 20; x <= 400; x += 50) {
        for (var y = 20; y <= 600; y += 100) {
            push();
            tealsquare(x, y);
            pop();
            
        }    
    }

    for (var x = 20; x <= 400; x += 50) {
        for (var y = 70; y <= 600; y += 100) {
            push();
            bluesquare(x, y);
            pop();           
        }    
    }

    noLoop();
}
function tealsquare(x, y) {
    // square
    noStroke();
    fill('teal');
    rect(x, y, size/2, size/2);
    
    // flower
    stroke('black');
    fill('lightblue');
    ellipse(x, y + size/6, size/3);
    ellipse(x, y - size/6, size/3);
    ellipse(x + size/6, y, size/3);
    ellipse(x - size/6, y, size/3);
    fill(84, 58, 68);
    ellipse(x, y, size/3);

    // arc
    noFill();
    stroke('lightblue');
    arc(x, y, 50, 50, 0, HALF_PI);
}

function bluesquare(x, y) {
    // circle
    noStroke();
    fill('lightblue');
    rect(x, y, size/2, size/2);
    
    //flower
    stroke('white');
    fill('teal');
    ellipse(x, y + size/6, size/3);
    ellipse(x, y - size/6, size/3);
    ellipse(x + size/6, y, size/3);
    ellipse(x - size/6, y, size/3);
    fill(84, 58, 68);
    ellipse(x, y, size/3);

    // arc
    noFill();
    stroke('teal');
    arc(x, y, 50, 50, 0, HALF_PI);
}

Project 5

sketch
//Keng Pu (Paul) Li
//section A 
//9/27/22
var numLines = 50;
var dx3;
var dy3;
var dx4;
var dy4;

function setup() {
    createCanvas(500,500);
   
}

function draw() {
    var backG = random(100,200);
    background(250,0,20,random(50,backG));
    for(var w = 0; w<7; w++){
        for(var i = 0; i<18; i++){
            push();
            scale(0.15);
            translate(390+w*525,-350+i*510);
            stringArt();
            pop();
        }

         for(var i = 0; i<18; i++){
            push();
            scale(0.15);
            translate(290+w*525,350+i*510);
            stringArtFlipped();
            pop();
        }
    }
    noLoop();
}

function stringArt(){
//string art like the ones from week 4 but tranformed
//most left
    dx3 = 5;
    dy3 = 1;
    dx4 = 5;
    dy4 = 5;

//most left 
    x3 = 0;
    y3 = width/2+100;
    x4 = width/2;
    y4 = width/2+100;
    for(var i = 0; i<40; i++){
        strokeWeight(4);
        stroke(255,90,180);
        line(x3,y3,x4,y4);
        x3 += dx3;
        y3 += dy3;
        x4 -= dx4;
        y4 += dy4;
    }
    push();
    translate(0,200);
     for(var i = 0; i<40; i++){
        strokeWeight(2);
        stroke(25,255,100);
        line(x3,y3,x4/4,y4/5);
        x3 -= dx3;
        y3 += dy3;
        x4 -= dx4;
        y4 += dy4;
    }
    pop();
}


function stringArtFlipped(){
//string art like the ones from week 4 but tranformed
//most left
    dx3 = 5;
    dy3 = 1;
    dx4 = 5;
    dy4 = 5;

//most left 
    x3 = 0;
    y3 = width/2+100;
    x4 = width/2;
    y4 = width/2+100;
    push();
    rotate(radians(180));
    for(var i = 0; i<40; i++){
        strokeWeight(2);
        stroke(0,90,180);
        line(x3,y3,x4,y4);
        x3 += dx3;
        y3 += dy3;
        x4 -= dx4;
        y4 += dy4;
    }
    push();
    translate(0,200);
     for(var i = 0; i<40; i++){
        strokeWeight(1);
        stroke(255,20,10);
        line(x3,y3,x4/4,y4/5);
        x3 -= dx3;
        y3 += dy3;
        x4 -= dx4;
        y4 += dy4;
    }
    pop();
    pop();
}

Project 05

this is my wallpaper:

sketch

var x
var y
function setup() {
    createCanvas(600, 600);
    background(236, 233, 216);
}
 
function draw() {
    //background
    backgroundLine();

    //blue triangle
    for (var y = 50; y < height-20; y += 100) {
        for (var x = 50; x < width-20; x += 50) {
            BlineTriangle(x, y)
        }
    }  

    //pink triangle
    for (var y = 50; y < height-20; y += 100) {
        for (var x = 50; x < width-20; x += 50) {
            PlineTriangle(x, y)
        }
    } 

    //brown circles
    noStroke();
    for (var b = 50; b < height-20; b += 100) {
        for (var a = 50; a < width-20; a += 50) {
          circle(a, b, 7); 
          fill(167, 105, 54, 170) 
        }
    } 

    
}

function BlineTriangle(x, y) {
    var dist = 4
    for (var i = 0; i<=20; i += 2) {
        stroke(90, 135, 145);
        strokeWeight(0.75)
        dist += 4*sqrt(3)/2;
        line((x-i), (y+dist), (x+i), (y+dist))
    }
}

function PlineTriangle(x, y) {
    var dist = 4
    for (var i = 0; i<=20; i += 2) {
        stroke(232, 163, 147);
        strokeWeight(0.75)
        dist += 4*sqrt(3)/2;
        line((x+i), (y-dist), (x-i), (y-dist))
    }
}

function backgroundLine() {
    noStroke();
    fill(240, 70);
    for(var i = 0; i <= 750; i += 50) {
        rect(0, i, 750, 10);
    }
}


project 5: wallpaper

floral wallpaperDownload
// isis berymon section D

function setup() {
    createCanvas(600, 600);
    background(206, 214, 204); //light green
}

function draw() {
    var x = -20; //negative so pattern doesnt stop at edge
    var y = -20;
    for(var i = 0; i < 6; i++){
        for(var j = 0; j < 6; j++){
            tile(x, y);
            x+=120;
        }
        y+=120;
        x = -20;
    }
}

function tile(x, y) {
    push();
    translate(x, y);
    //branches
    stroke(120, 105, 80); //brown
    line(26, 0, 38, 12); //touches top
    line(40, 19, 20, 39);
    line(0, 27,14, 14); //touches left 1
    line(4, 24, 54, 73);
    line(54, 73, 70, 56);
    line(47, 66, 33, 80);
    line(24, 74, 13, 63);
    line(13, 63, 0, 75); //touches left 2
    line(27, 120, 15, 108); //touches bottom
    line(15, 108, 29, 94);
    line(29, 94, 41, 106);
    line(41, 106, 64, 83);
    line(64, 83, 84, 102);
    line(84, 102, 93, 93);
    line(92, 120, 115, 97);
    line(115, 97, 91, 73);
    line(91, 73, 104, 59);
    line(104, 59, 120, 75); //touches right 2
    line(97, 66, 88, 57);
    line(88, 57, 98, 46);
    line(120, 27, 108, 37); //touches right 1
    line(108, 37, 88, 17);
    line(88, 17, 91, 13);
    //flowers
    flower(41, 20);
    flower(102, 42);
    flower(18, 46);
    flower(73, 53);
    flower(28, 79);
    flower(63, 88);
    flower(12, 110);
    flower(93, 124);
    pop();
}

function flower(x, y) {
    noStroke();
    fill(187, 166, 212); //purple petals
    circle(x, y-6, 10);
    circle(x+6, y, 10);
    circle(x, y+6, 10);
    circle(x-6, y, 10);
    circle()
    fill(240, 228, 188); //yellow center
    circle(x, y, 6);
}

Project-05-Wallpaper

sketch
// Emily Franco
// Section C
// efranco@andrew.cmu.edu
// Project-05
 

var colorState; 

function setup() {
    createCanvas(500, 500);
    background (255,248,228);
}

function draw() { 
	var dim = 70;
	var rad = dim/2;
	colorState = 0; 

	for (var x=rad;x<=width-rad;x+=dim*2){
		for (var y=rad;y<=height-rad;y+=dim){
			cirColorOne(colorState);
			drawPiece(x,y,dim,rad);
		}
	}
	

	for (var x=dim+rad;x<=width-rad;x+=dim*2){
		for (var y=rad;y<=height-rad;y+=dim){
			cirColorTwo(colorState);
			drawPiece(x,y,dim,rad);
		}
	}


	noLoop();
} 

function drawPiece (x,y,dim,rad){
	var angleX;
	var angleY;

	//move origin
	translate (x,y);

	push();
	//random rotation angle from array
	randRot();

	push();
	noStroke();
	//draw semi circle
	arc(0,0,dim,dim,radians(90), radians(270),CHORD);
	pop(); 

	//draw lines in piece 
	for(var polarPos=85;polarPos>=10;polarPos-=5){
		angleX = rad*cos(radians(polarPos));
		angleY = rad*sin(radians(polarPos));

		strokeWeight(0.25);
		line(angleX,-angleY,angleX,angleY);

		//increase gap between lines so they dont blur together
		if(polarPos<=30){
			polarPos -=2;
		}
	}

	pop();

	//reset origin
    translate(-x,-y);
}

function randRot(){
	//rotate piece at one of 4 angles
	var rotateAngles = [0,90,180,270];

	//selec rand int
	var rotAngle = floor(random(0,4));
	rotate (radians(rotateAngles[rotAngle])); 
}

function cirColorOne(state){
	if(state==0){
		//yellow
		fill(255,206,109);
	}else if(state==1){
		//black
		fill(49,49,49);
		colorState = -1;
	}
	colorState+=1;
}

function cirColorTwo(state){
	if(state==0){
		//orange
		fill(255,105,33); 
	}else if(state==1){
		//blue
		fill(125,173,198); 
		colorState = -1;
	}
	colorState+=1;
}