/*
Doo Won Nam
Section B
dnam@andrew.cmu.edu
Project - 05
*/
function setup() {
createCanvas(600, 600);
background(142, 4, 2); //red background
}
function draw() {
var rng = random()
for (var y = 50; y < height -5; y += 100) { //small rectangles
for (var x = 50; x < width - 5; x += 100) {
//x and y increases depending on the line
noStroke();
fill(10, 46, 28); //dark green
rect(x, y, 40, 40);
}
}
for (var y = 40; y < height -5; y += 150) { //big circles
for (var x = 40; x < width - 5; x += 150) {
noStroke();
fill(9, 20, 1); // darker green
rect(x, y, 70, 70);
}
}
//generate white randomly depending on the refresh
stroke("white");
var lineX = random(20, 400);
for (var lX = 0; lX < width; lX += lineX)
line(lX, 0, lX, 600);
noLoop(); // not constantly creating lines
}
Inspired from CMU’s tartan pattern, I wanted to make a background wallpaper that resembles the red, green, and white rectangles and line. I wanted to make the pattern lines refresh and have a new look everytime. The small rectangles change positions each line to make it more visually interesting.