zhuoyinl-project04

my-sketch.js



function setup() {
  createCanvas(640, 480);
}

function draw() {
  background('lightpink');

//blue lines
  for (i = 0; i < 50; i++) {
    x1 = 0;
    y1 = 480;
    x2 = 0;
    y2 = 0;

    x1+= (i*60);
    y1+= (i*5);
    y2+= (i*20);
    stroke('lightblue');
    strokeWeight(1);
    line(x1, y1, x2, y2);
  }

//yellow lines
  for (i = 0; i<50; i++) {
    x1 = 640;
    y1 = 480;
    x2 = 640;
    y2 = 240;

    x1-= (i*20);
    y1+= (i*1);
    x2+= (i*2);
    y2+= (i*10);

    stroke(255, 240, 1);
    strokeWeight(1);
    line(x1, y1, x2, y2);

  }

//grey lines
for (i = 0; i<50; i++) {
    x1 = 320;
    y1 = 0;
    x2 = 640;
    y2 = 0;

    x1+= (i*16);
    y2+= (i*15);

    stroke(159, 150, 141);
    strokeWeight(1);
    line(x1, y1, x2, y2);

  }

//green lines
for (i = 0; i<50; i++) {
    x1 = 640;
    y1 = 0;
    x2 = 640;
    y2 = 480;

    x1-= (i*39);
    y1-= (i*5);
    y2-= (i*10);

    stroke(154, 231, 217);
    strokeWeight(1);
    line(x1, y1, x2, y2);

  }

//purple lines
for (i = 0; i<50; i++) {
    x1 = 0;
    y1 = 0;
    x2 = 0
    y2 = 240;

    x1+= (i*16);
    y2-= (i*10);

    stroke(193, 155, 223);
    strokeWeight(1);
    line(x1, y1, x2, y2);

  }
  

//pink lines
for (i = 0; i<50; i++) {
    x1 = 0;
    y1 = 240;
    x2 = 0
    y2 = 480;

    x1-= (i*3)
    y1+= (i*15);
    x2+= (i*20);
    y2-= (i*.01)

    stroke(250, 104, 127);
    strokeWeight(1);
    line(x1, y1, x2, y2);
  }

  //dark green lines
  for (i = 0; i < 50; i++) {
    x1 = 640;
    y1 = 0;
    x2 = 0;
    y2 = 0;

    x1-= (i*30);
    y1+= (i*.1);
    x2+= (i*.1);
    y2+= (i*25);
    stroke(155, 183, 212);
    strokeWeight(1);
    line(x1, y1, x2, y2);
  }

  //light grey lines
  for (i = 0; i < 50; i++) {
    x1 = 0;
    y1 = 480;
    x2 = 640;
    y2 = 480;

    x1+= (i*30);
    y1+= (i*.1);
    x2+= (i*.1);
    y2-= (i*25);
    stroke(209, 190, 199);
    strokeWeight(1);
    line(x1, y1, x2, y2);
  }
  
}

I used multiple grids along the edges of the canvas to create the pattern. The different color creating a depth to the pattern.

Leave a Reply