//Siwei Xie
//Section B
//sxie1@andrew.cmu.edu
//Project-05-wallpaper
function setup() {
createCanvas(400, 400);
background(236, 214, 180);
}
function draw() {
//use Nested Loop to create shapes
for (var j = 0; j < 13; j++) {
for (var i = 0; i < 12; i++) {
//maroon circles
noStroke();
fill(185, 88, 84);
circle(i * 46 + 15, j * 30 + 15, 20);
//yellow triangles
fill("yellow");
triangle(i*40+65, j*40+20, i*40+5, j*40+50, i*40+35, j*40+50);
//white verticle lines
fill("white");
rect(i*46+15, 0, 3, 400);
}
}
noLoop();
}
Nested loop is a very useful tool when creating repetitive patterns. It was fun to design an aesthetically pleasing image by balancing the colors and shapes of different elements.
I researched wallpaper or tablecloth patterns on the internet first, then tried to design my own image. I set the overall color to be soft and harmonious, by using a combination of pink, maroon, light yellow and white. The shapes I used include triangles, circles and rectangles, which overlap on each other to create a harmonious pattern.