Project – 03 – dynamic drawing: le fleur

Inspired by the fun and colorful designs of brand : GOLF le FLEUR.

le fleurDownload
function setup() {
    createCanvas(600, 450);
    background(220);

}

function draw() {
    background(0);
    var m = max(min(mouseX, 600), 0);
    var Xsize = m * 550 / 600;
    var mY = max(0, min(mouseY, 450));
    var Ysize = mY * 400 / 450 - 200;
    noStroke();
    translate(300, 225); //center of canvas
    push();
    if(Xsize > 100){
        background(93, 240,235) // teal
    }else{
    	background(255) //white
    }
    fill(255);
    circle(0, 0, -Xsize);
    push();
    fill(242, 156, 56);
    rotate(radians(45));
    translate(200, 0)
    ellipse(0, 0, Xsize, Ysize); //right angled petal
    translate(-400, 0);
    ellipse(0, 0, Xsize, Ysize); //left angled petal
    translate(200, 100);
    ellipse(0, 0, Ysize , Xsize); //bottom angled petal
    translate(0, -200);
    ellipse(0, 0, Ysize, Xsize); //top angled petal
    pop()
    translate(200, 0); //right
    if (mouseY > height/2){
    	 fill(245, 89, 174); // pink
    } else{
    	fill(240, 186, 93); //orange
    }
    ellipse(0, 0, Xsize, Ysize - 200); //right petal
    translate(-400, 0);
    ellipse(0, 0, Xsize, Ysize - 200); //left petal
    translate(200, 100);
    ellipse(0, 0, Ysize - 200 , Xsize); //bottom petal
    translate(0, -200);
    ellipse(0, 0, Ysize - 200, Xsize); //top petal
    pop();
    fill(136, 218, 97); //green
    Xsize = 600 - Xsize
    circle(0, 0, Xsize); //stem
    if(Xsize > 500){
    	fill(255);
    	textSize(40)
    	text("le fleur", -50, 0);

    }
    

}

Leave a Reply