Project 5 – Wallpaper

In this work I tried to incorporate the four colors of the Korean flag: red, blue, black and white, in addition to the rectangles present on the flag, and a brief geometric shape of the national flower (Mugunghwa).

var col;
var row;
var col1;
var row1;
function setup() {
    createCanvas(600, 600);
}

function draw() {
    background(0);
    rectangles();
    for(col = 60; col <= 600; col += 200) {
        for(row = 60; row <=600; row += 200) {
            flowers(col,row);
            print(row);
        }
        print(col);
    }
    noLoop();
    for(col1 = 150; col1 <= 600; col1 += 200) {
        for(row1 = 150; row1 <= 600; row1 += 200) {
            flowers(col1, row1);
        }
    }
}

function rectangles(){
    for(var x = 0; x<=600; x +=90){
        for (var y=20; y<=600; y +=50){
        fill(255);
        rect(x,y,55,15);    
        }
    
    }
}


function flowers(x,y) {
    push();
    translate(x,y);
    fill(255,0,0);
    ellipse(25,0,30,30);
    rotate(PI/3);
    fill(0,0,153);
    ellipse(25,0,30,30);
    rotate(PI/3);
    fill(255,0,0)
    ellipse(25,0,30,30);
    rotate(PI/3);
    fill(0,0,153);
    ellipse(25,0,30,30);
    rotate(PI/3);
    fill(255,0,0);
    ellipse(25,0,30,30);
    rotate(PI/3);
    fill(0,0,153);
    ellipse(25,0,30,30);
    fill(230,230,250);
    ellipse(0,0,15,15);
    pop();
}

Leave a Reply