kyungak-project-05-wallpaper

sketch

//Kyunga Ko
//15104B
//kyungak@andrew.cmu.edu
//Project-05

var rows = 8;
var collums = 8;
var cirdia = 85;
var disX = 60;
var disY = 60;
var disX2 = 30;
var disY2 = 30;

function setup() {
    createCanvas(480, 480);
    noStroke();
}

function draw() {
    bloomingbackground();
}

function bloomingbackground() {
    background(255);
    for (var r=0; r<=rows; r++) {
        for (var c=0; c<=collums; c++) {

            if ((r+c)%2 == 0) {
                fill(135,47,40,50);
            } 

            else {
                fill(240,177,173,100);
            }
            //creates flower shaped pedals and the star shaped background
            ellipse(disX*c,disY*r,cirdia,cirdia); //overlap of bigger ellipse
        }

    }

    for (var r=1; r<=15; r++) {
        for (var c=1; c<=15; c++) {

            if((r+c)%2 == 0 & r%2 == 1) { 
                fill(255,255,255,200);
                noStroke();
                ellipse(disX2*r,disY2*c,20,20); // white center of the flowers

                strokeWeight(2);
                stroke(255,255,255,100);
                line(disX2*r,disY2*c-20,disX2*r,disY2*c-10); //upper pedal line
                line(disX2*r,disY2*c+10,disX2*r,disY2*c+20); //lower pedal line
                line(disX2*r-20,disY2*c,disX2*r-10,disY2*c); //left pedal line
                line(disX2*r+10,disY2*c,disX2*r+20,disY2*c); //right pedal line
            }
        }
    }

    noLoop();
}

The theme of this wallpaper is blooming flowers. I created pedals by playing with the transparency of the for looped ellipses. The overlapping parts became more saturated than the background and thus looked like pedals from the screen. I then added white pedal marks on each pedals to emphasize the flowers over the pink and brownish background. The results were satisfying and the process allowed me to thoroughly practice the for loop function once again. It was fun.

Leave a Reply