// Kyle Leve
// kleve@andrew.cmu.edu
// Section A
// Project-05-Wallpaper
var x = 0;
var y = 10;
var spacing = 20;
var spacing2 = 440;
var spacing3 = 50;
var cirX = 15;
var cirY = 10;
var cirX2 = 240;
var cirY2 = 10;
var cirX3 = 50;
var cirY3 = 50;
var curveX = 240;
var curveY = 240;
function setup() {
createCanvas(480, 480);
background(0, 100, 200);
noLoop();
}
function draw() {
for (y = 0; y <= height; y += spacing) { // Creates repeated purple horizontal lines
stroke('purple');
strokeWeight(3);
line(x, y, width, y);
}
for (cirX = 0; cirX < (0.5 * width); cirX += spacing) { // Creates light blue repeated circles
for (cirY = 0; cirY < height; cirY += spacing) {
fill('skyblue');
stroke('blue');
strokeWeight(2);
ellipse(cirX + 10, cirY + 10, 15, 15);
}
}
for (cirX2 = 240; cirX2 <= width; cirX2 += spacing) { // Creates light green repeated circles
for (cirY2 = 0; cirY2 < height; cirY2 += spacing) {
fill('lightgreen');
stroke('green');
strokeWeight(2);
ellipse(cirX2 + 10, cirY2 + 10, 15, 15);
}
}
for (cirX3 = 0; cirX3 <= 480; cirX3 += spacing2) { // Creates the four silver circles in the corners
for (cirY3 = 0; cirY3 <= 480; cirY3 += spacing2) {
fill('silver');
stroke(0);
ellipse(cirX3 + 20, cirY3 + 20, 15, 15);
}
}
// Creates the purple and orange patterns in the center
fill('violet');
stroke('purple')
strokeWeight(5);
curve(curveX, height, curveX, height, curveX, 0.75 * height, 800, 280);
fill('orange');
stroke('red')
strokeWeight(5);
curve(curveY, height, curveY, height, curveY, 0.75 * height, -320, 280);
fill('violet');
stroke('purple')
strokeWeight(5);
curve(curveX, 0.75 * height, curveX, 0.75 * height, curveX, 0.5 * height, 800, 140);
fill('orange');
stroke('red')
strokeWeight(5);
curve(curveY, 0.75 * height, curveY, 0.75 * height, curveY, 0.5 * height, -320, 140);
fill('violet');
stroke('purple')
strokeWeight(5);
curve(curveX, 0.5 * height, curveX, 0.5 * height, curveX, 0.25 * height, 800, 0);
fill('orange');
stroke('red')
strokeWeight(5);
curve(curveY, 0.5 * height, curveY, 0.5 * height, curveY, 0.25 * height, -320, 0);
fill('violet');
stroke('purple')
strokeWeight(5);
curve(curveX, 0.25 * height, curveX, 0.25 * height, curveX, 0, 800, -100);
fill('orange');
stroke('red')
strokeWeight(5);
curve(curveY, 0.25 * height, curveY, 0.25 * height, curveY, 0, -320, -100);
}
Starting this project I knew I wanted to experiment with different sides of the canvas. I decided to make the center of the canvas a divider where I would have the same thing on both sides, however different colors. I experimented with the curve function to create the centerpiece rather than doing the circles that I had intended. Overall, I enjoyed this project because my ideas were able to develop and evolve after the initial draw phase.