// Sarah Luongo
// sluongo
// Section A
function setup() {
createCanvas(465, 465);
background(84, 141, 155);
noLoop();
}
function flower() {
push();
translate(74, 74);
// Purple petals
for (var i = 0; i < 4; i ++) {
noStroke();
fill(51, 0, 102);
ellipse(0, -15, 15, 25);
triangle(-6, -22.63, 6, -22.63, 0, -31);
stroke(229, 204, 0);
strokeWeight(1);
line(0, -16, 0, -11);
rotate(radians(90));
}
// Pink petals
push();
rotate(radians(45));
for (var i = 0 ; i < 4; i ++) {
noStroke();
fill(255, 204, 204);
ellipse(-20, 0, 40, 15);
triangle(-34, -5.4, -34, 5.4, -45, 0);
fill(0, 0, 255);
circle(-9, 0, 2);
rotate(radians(90));
}
pop();
// Center of flower
noStroke();
fill(55, 24, 85);
circle(0, 0, 12);
pop();
}
// Horizontal vines
function vinesH() {
// Vines
noFill();
stroke(24, 129, 24);
strokeWeight(2);
bezier(1, 74, 15, 85, 25, 65, 40, 74);
// Leaves
noStroke();
fill(24, 129, 24);
ellipse(8, 72, 3, 9); // Left-most leaf
ellipse(22, 79, 4, 10); // Center leaf
ellipse(38, 69, 2, 7); // Right-most leaf
}
// Vertical vines
function vinesV() {
// Vines
noFill();
stroke(24, 129, 24);
strokeWeight(2);
bezier(74, 1, 85, 15, 65, 25, 74, 40);
// Leaves
noStroke();
fill(24, 129, 24);
ellipse(72, 8, 9, 3); // Top-most leaf
ellipse(79, 22, 10, 4); // Center leaf
ellipse(69, 38, 7, 2); // Bottom-most leaf
}
function draw() {
for (var i = 0; i < 5; i++) {
for(var j = 0; j < 5; j++) {
push();
translate(106*i, 106*j);
vinesH();
vinesV();
flower();
pop();
}
}
}
I wanted to do a floral pattern because I love flowers. I also really ran with the idea of creating something I would wear. I actually have a floral shirt with variations of pink flowers, and this is slightly based off of it. I normally draw flowers as I have created in this code (which you can see from the sketch below), and I wanted the multiple petals to make them all different colors. However, the colors I chose were different from the sketch because I didn’t have many pen options on my tablet, if I did they would have been the colors I choose in this code as they are all colors I love!