//Helen Wu
//Section A
//hdw@andrew.cmu.edu
//Project 5
function setup() {
createCanvas(400, 400);
fill(255)
}
function draw() {
var x = 10 //x-center for yellow circle
var y = 10 //y-center for circle
var r = 5 //radius for all circles
var spacing = 20 //spacing between each tile
var lx //pink lines
//draw the lines that divide each column of flowers
for (var lx = 20; lx <=400; lx+=spacing){
stroke(255,200,241);
line(lx,0,lx,400);
}
//leaves and leaf lines
for (var b = 1; b<=400; b+=spacing){
for (var a = 1; a <=400; a+=spacing){
fill(147,216,140);
noStroke()
quad(a,b, a,3+b, 6+a,6+b, 3+a,b);
stroke(7,89,0)
strokeWeight(1)
line(a,b,6+a,6+b)
}
}
//yellow circles
for (var y = 10; y <= 400; y+=spacing){
for (var x = 10; x <= 400; x+=spacing){
fill(255,249,100);
noStroke();
ellipse(x,y,r,r);
}
}
//bottom flower petal
push()
translate(0,5);
for (var y = 10; y <= 400; y+=spacing){
for (var x = 10; x <= 400; x+=spacing){
fill(255,0,63);
stroke(255,200,241);
strokeWeight(1);
ellipse(x,y,r,r);
}
}
pop()
//top flower petal
push()
translate(0,-5);
for (var y = 10; y <= 400; y+=spacing){
for (var x = 10; x <= 400; x+=spacing){
fill(255,0,63);
stroke(255,200,241);
strokeWeight(1);
ellipse(x,y,r,r);
}
}
pop()
//right flower petal
push()
translate(5,0);
for (var y = 10; y <= 400; y+=spacing){
for (var x = 10; x <= 400; x+=spacing){
fill(255,0,63);
stroke(255,200,241);
strokeWeight(1);
ellipse(x,y,r,r);
}
}
pop()
//left flower petal
push()
translate(-5,0);
for (var y = 10; y <= 400; y+=spacing){
for (var x = 10; x <= 400; x+=spacing){
fill(255,0,63);
stroke(255,200,241);
strokeWeight(1);
ellipse(x,y,r,r);
}
}
pop()
}
This week’s project was inspired the small patterns on early settler’s clothes in the west. I guess I kind of miss home. :’)
I drew on the back of a Fuku Tea receipt to plan out the shapes. I struggled with the leaf placement variables but figured it out.