//Erin Fuller
//SectionA
//efuller@andrew.cmu.edu
//Project 05 - WallPaper
function setup() {
createCanvas(600, 400);
noLoop();
}
function draw() {
background(255, 206, 233);
for (var i = -1; i < 6; i++) { //for loop to make grid of "tiles"
for (var j = -1; j < 4; j++) {
rX = i * 100; // tile spacing
rY = j * 100;// tile spacing
tile(); //runs "tile" function where all my actual components are
}
}
}
function tile() {
squiggle(); //runs two arc functions to make "squiggle"
triangles(); //draws 2 triangles offset
circles(); //draws 2 circles offset
}
function squiggle() {
strokeWeight(6);
stroke(0);
noFill();
arc(rX + 30, rY, 30, 30, PI, 3 * HALF_PI); // upper curve
arc(rX + 30, rY + 70, -30, 30, 0, 3 * HALF_PI); // lower curve
}
function triangles() {
noStroke();
fill(0); // background triangle always black
triangle(rX + 80, rY + 5, rX + 35, rY + 55, rX + 80, rY + 55);
fill(random(255), random(255), random(255)); // makes front triangle fun colors!
triangle(rX + 85, rY + 10, rX + 40, rY + 60, rX + 85, rY + 60);
}
function circles() {
noStroke();
fill(0); //background circle always black
ellipse(rX + 30, rY + 25, 15, 15);
fill(random(255), random(255), random(255)); //makes front circle fun colors!
ellipse(rX + 25, rY + 20, 15, 15);
}
My inspiration was that I wanted my wallpaper to look like a fun 90s pattern. I made the objects in separate functions and tiled them using a for-loop. A neat thing is the triangle and circles are random fills so everytime you refresh it is a color!