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();
  }
}

Leave a Reply