Project-06: Abstract Clock

This project posed a large challenge in how I was going to sync up each lightning strike on the minute, but it turned out to be a really simple solution once I sat down to get it. On each minute, lightning strikes as a line and strokeWeight decreases over the minute, causing it to fade like a real strike. Every hour, another cloud is added until it resets at 00:00.

cloud

var cloudx = [] //where to draw each cloud
var cloudy = []
var strikeTime; //the timing of the lightning strike







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

function draw() {
    numClouds = hour() //adds a cloud for every hour
    strikeTime = ((60 - second()) / 10) //lightning strikes on the minute and fades
    background(48, 4, 181)
        for (m = 0; m <= numClouds; m ++) { //randomly determines cloud coordinates and sends to array
        		cloudx.push(random(40, 440))
        		cloudy.push(random(40, 440))
}
        for (i = 0; i < numClouds; i++) { //draws cloud and lightning
        	cloud(cloudx[i], cloudy[i], 15)
        	strike(cloudx[i], cloudy[i])
        	         }
}

function cloud(cloudx, cloudy, cloudsize){ //instructions for each cloud
	push()
	translate(cloudx, cloudy)
	fill(40, 40, 40, 188)
	ellipse(-10, 0, cloudsize)
	ellipse(0, -10, cloudsize)
	ellipse(0, 0, cloudsize)
	ellipse(10, 0, cloudsize)
	pop()
}



function strike(cloudx, cloudy){ //instructions for lightning
    push()
	translate(cloudx, cloudy)
	strokeWeight(strikeTime)
	stroke(255, 255, 0)
	line(0, 0, 10, 10)
	line(10, 10, -20, 20)
	line(-20, 20, 15, 30)
	pop()
}

LO-06: Randomness

I looked into the String Quartet by Witold Lutoslawski, a randomly determined piece made in the 20th century style of aleatoricism, a composition style where elements of the score and performance are left to chance. Many of the rhythms and articulations of the piece are left up to chance, such as repetition until the audience is quiet, or determining tempo through counting seconds. An analysis of the score shows it to be very complex, with new music notations such as wavy lines as beams and instructions on the score. It appears to be chaotic and disjointed but various elements of the score show that it is heavily dependent on communication by the members of the quartet, with synchronized exits and entrances. Repetitions are also determined by the members of the quartet or the audience. Lutoslawski experienced great repression of his work by the Soviet Union, with some of his pieces being banned for “inaccessibility”. However, he only lived in the USSR as he was forced out of Poland by World War II. His music, I believe, reflects these challenges but also acknowledges order and stability in dark times, when each part comes together to create flowing soundscapes and peaceful silence.

LO-06 (randomness)

For this LO, I scoured the internet for randomness projects and I ultimately came upon this random script generator. Although the creation date and author is unknown, it is quite a robust software. After generating multiple scripts using a variation of around 30 inputs to generate the script, it was pretty clear that the results had enough variation to deem it to be sufficiently random. However, just how random is this script exactly? Assuming all 30 inputs each change a small part of the script then there could be theoretically be up to 30^30*the available words in the dictionary versions of scripts generated. This isn’t the case though, as after reading a couple scripts, I noticed that many themes and sentences were in fact being repurposed and reused, thus this program utilizes “pseudo” randomness.

https://www.plot-generator.org.uk/movie-script/

PROJECT-06 (clock)

move your mouse around to stabilize the clock!

sketch
// SEAN CHEN
// 15-104 A

function setup() {
    createCanvas(600, 600);
    background(255);
}

function randomizer() { // giving the design "chaos"
    var diff = dist(width/2, height/2, mouseX, mouseY);
    if (diff > 25) {
        // more random shifting based on dist from center to mouse
        var chaos = random(-1, 1) * (diff-25)/25;
    } else {
        var chaos = random(-1, 1) * 0.175; // mini shifts for "texture"
    }
    return chaos;
}

function border() { // border ring including seconds hand
    textAlign(CENTER, BOTTOM);
    for (var i = 0; i < 60; i++) {
        push();
        textSize(9);
        if (second() == i) { // if second matches rotation, display sec location
            rotate(radians(6*i+randomizer()));
            textStyle(ITALIC);
            textStyle(BOLD);
            textAlign(LEFT, CENTER);
            rotate(radians(-90)); 
            text(' second ' + second(), 250+randomizer(), 0);
        } else { // say border otherwise
            rotate(radians(6*i+randomizer()));
            text('border', 0, -250+randomizer());
        }
        pop();
    }

}

function face() { // clock face
    push();
    textAlign(CENTER, BOTTOM);
    var diff = dist(width/2, height/2, mouseX, mouseY);
    fill(color(constrain(200-diff, 0, 200)));
    for (var thick = 0; thick < 25; thick++){
        for (var i = 0; i < 60; i++) {
            push();
            rotate(radians(6*i));
            textSize(9);
            text('face', 0, -10*(thick+randomizer()));
            pop();
        }
    }
    pop();
}

function minHand() { // minute hand
    push();
    rotate(radians(6*minute()+randomizer()));
    textSize(9);
    textStyle(ITALIC);
    textStyle(BOLD);
    textAlign(LEFT, CENTER);
    for (var num = 0; num < 7; num++) { // length of hand
        push();
        rotate(radians(-90+randomizer()));
        if (num < 6) {
            text('minute', 30*num+20, 0);
        } else {
            text('minute '+ minute(), 30*num+20, 0);
        }
        pop();
    }
    pop();
}

function hrHand() { // hour hand
    var hr;
    if (hour() > 12) { // convert 24 hr to 12 hr
        hr = hour()-12;
    } else {
        hr = hour();
    }
    push();
    rotate(radians(30*hr+randomizer()));
    textSize(9);
    textStyle(ITALIC);
    textStyle(BOLD);
    textAlign(LEFT, CENTER);
    for (var num = 0; num < 7; num++) { // length of hand
        push();
        rotate(radians(-90+randomizer()));
        if (num < 6) {
            text('hour', 20*num+20, 0);
        } else {
            text('hour '+hr, 20*num+20, 0);
        }
        pop();
    }
    pop();
}

function logo() { // how to operate clock
    push();
    strokeWeight(2);
    var diff = dist(width/2, height/2, mouseX, mouseY);
    ellipse(mouseX, mouseY, 5*diff/10, 2.5*diff/10);
    textStyle(ITALIC);
    textAlign(CENTER, CENTER);
    textSize(8*diff/100);
    text('clock', mouseX, mouseY);
    textSize(3*diff/100);
    textAlign(CENTER, CENTER);
    text('\n(move to stablize)', mouseX, mouseY+7);
    pop();
}

function draw() {
    background(255);
    push();
    translate(width/2+randomizer(), height/2+randomizer()); 
    border();
    face();
    minHand();
    hrHand();
    pop();
    logo();
}

Project-06-Abstract-Clock

The Flower Clock

My idea is to represent time through the growth of an Equinox Flower. This kind of flower is associated with final goodbyes, and legend has it that these flowers grow wherever people part ways for good. In old Buddhist writings, the Equinox Flower is said to guide the dead through samsara, the cycle of rebirth.

The size of the pedals is associated with the unit of time they represent. For example, the inner circle of pedals change their size according to seconds went by.

sketch

var x;
var y;
//r represent how far each pedal is from the center
var r=80;
var l=r/2*3;
var angle=0;
var size;
function setup() {
    createCanvas(400, 600);
    angleMode(DEGREES);

    
}

function draw() {
	background(0,19,30);
    var s=second();
    var m=minute();
    var h=hour();
    
    //draw the stem first;
    stem();
    //move the center of the flower to the center;
	translate(width/2,height/2-50);
	push();
		

	//the size of this set of Equinox pedal represents the hour
		if(!h%24==0){
			r=120;
			size=map(hour(),0,60,2,3.5);
			for(var i=0;i<=5;i++){
			  angle+=60;
			  Equinox(r*cos(angle),r*sin(angle),l,size,132);
		    }
		}
		
    //the size of this set of Equinox pedal represents the second
		if(!s%60==0){
			r=60;
			size=map(second(),1,60,0.2,1.5);
			for(var i=0;i<=5;i++){
			  angle+=60;
			  Equinox(r*cos(angle),r*sin(angle),l,size,236);
			
		    }
		}
	//the size of this set of Equinox pedal represents the mintue
		if(!m%60==0){
			r=80;
			size=map(minute(),0,60,1.5,2.0);
			for(var i=0;i<=5;i++){
			angle+=60;
			Equinox(r*cos(angle),r*sin(angle),l,size,181);
		}
		
		pop();
	}


 }
    
function stem(){
	
    push();
    fill(88,122,72,60);
    translate(width/2,250);
    noStroke();
    //this for loop draws the growing calyx at the center
    for (var r = 0; r < 10; r++) {
        if (frameCount <= 180) {
         ellipse(0, 6 + frameCount / 20, 6 + frameCount / 40, 12 + frameCount / 20);
        }
        if (frameCount > 180) {
        frameCount=0;
        }
         rotate(360 / 5);
    }
    pop();
    //main stem
	stroke(88,122,72,120);
	strokeWeight(5);
	line(width/2-20,600,width/2,250);
		
		
	
}
//x and y represent the location; l is the distance to the center; s is the size; c is the color
function Equinox(x,y,l,s,c){
	var w=105;
	var h=50;
	var start=135;
	var end=225;
	push();
//locate each unit's position
	translate(x,y);
	scale(size);
//c is the shade of red each layer has
	stroke(c,50,50);
	strokeWeight(0.5);
	noFill();
//move each unit further from the center
	translate(-l,-105/2);
	rotate(-90);
	for(var i=0;i<7;i++){
      arc(0,l, w,h,start,end);
      w=w*Math.pow( 1.001, 10 );
      h+=8;
      start-=5;
      end+=5;

	}

	
	pop();

	}
	


Equinox Flower
Sketch of ideas for flower clock

LookingOutwards-06

The project I want to talk about is a Perlin Noise project created by Victor Vergara. I admire how the outcome is leveraged on different factors, which gives some level of rationale for the arbitrary.


The code is consist of four functions: createPrimitive(); createGUI(); and animation(). The motion graphic started with a primitive setup, whereas the graphic user interface on the left allows the user to manipulate the input.
The contribution of the creator is more about the rules, logic, and coded relationships rather than the output of that process. Indeed, when playing with randomness, the algorithm is more emphasized than the result.

Link: http://www.dstrict.com/arttechfactory/en/34-SLS-hotel-PROPERTY-DEVELOPMENT.html

Project 06 – Abstract Clock

I took inspiration from cuckoo clocks to make an abstract clock based on a face. The clock gets increasingly fatigued as its tongue inches out with every minute– its cheeks flush and the background also becomes redder with every hour. Saliva drip documents seconds.

sketch
Concept sketch
Illustrator sketch


function setup() {
  createCanvas(480, 480);
  // time
    var minShift= 2 * minute();
}

function draw(){
  
  //background
  var top = color(200, 219, 162); // pale green
  var bottom = color(124 +3*hour(), 124-hour(), 232- 3*hour()); // purple, turns redder with hours
  setGradient(top, bottom); // background gradient
    //offwhite wall
    noStroke();
    fill(240, 244, 237); //offwhite
    rect(368, 0, 124, height);
  clock();
  
}

function setGradient(color1, color2) { //background gradient
    for(var a = 0; a <= height; a++) {
      var amount = map(a, 0, height, 0, 1);
      var back = lerpColor(color1, color2, amount);
      stroke(back);
      line(0, a, width, a);
    }
}

function clock(){
  //base face
  fill(67, 40, 144);
  rect(0, 58, 265, 330, 0, 110, 0, 0);
  //face side panel
  fill(234, 249, 48); //neon yellow
  rect(-161, 58, 265, 330, 0, 110, 0, 0);
  //pendulum
  fill(208, 216, 91); //darker yellow
  rect(120, 388, 5, 92);
  rect(145, 388, 5, 92);
  //mouth opening
  rect (181, 300, 75, 50, 24, 0, 0, 0);
  //teeth
  fill(240, 244, 237);
  rect (228, 300, 13, 10);
  rect (243, 300, 13, 10);
  //eyes
  eyes();
  //blush
  blush();
  //nose
  fill(170, 192, 255); //lavender
  rect(177, 163, 24, 120);
  triangle(201, 164, 201, 284, 256, 284);
  fill (234, 249, 48); //neon yellow
  triangle(177, 164, 177, 284, 232, 284);
  //lines
  stroke(234, 249, 48);
  strokeWeight(0.75);
  line (83, 163, 248, 163);
  line (177, 141, 177, 379);
  //tongue
  tongue();
  
}

function eyes(){
  //whites
  push();
  fill(240, 244, 237);
  stroke(255, 73, 165);
  strokeWeight(3);
  strokeCap (SQUARE);
  arc(134, 228, 80, 80, PI, TWO_PI, OPEN);
  arc(230, 215, 61, 61, PI, TWO_PI, OPEN);
  //pupils
  fill(255, 73, 165); //pink
  ellipse(153, 213, 22);
  ellipse( 240, 203, 19);
  pop();
}

function blush(){
  fill(255, 73, 165 - 2*hour()); //pink becomes more red with hours
  ellipse(247, 247, 48+ hour());// blush increases with hours
  ellipse(111, 277, 74 + hour());
}

function tongue(){
  fill(255, 73, 165); //pink
  noStroke();
  var minShift= 2*minute();
  rect (181, 334, 154 + minShift, 16, 0, 15, 0, 0); //tongue length increases with minutes
  bird();
  
  // saliva drips by seconds and follows tongue
  fill(170, 192, 255); //lavender
  ellipse(307+ minShift, 376+ second(), 18); 
  triangle(300 + minShift, 370+ second(), 314+ minShift, 370+ second(), 307 + minShift, 360+ second());
  fill(170, 206, 255); //lighter lavender
  ellipse(287+ minShift, 364+ 2*second(), 26); 
  triangle(277 + minShift, 356+ 2*second(), 297+ minShift, 356+ 2*second(), 287 + minShift, 340+ 2*second());
}

function bird(){
  var minShift = 2* minute();
  //feet
  fill(208, 216, 91); //darker yellow
  rect(296 + minShift, 331, 15, 4, 0, 3, 0, 0);
  //legs
  stroke(208, 216, 91); //darker yellow
  strokeWeight(2);
  line(297 + minShift, 306, 297 + minShift, 334);
  line(301 + minShift, 306, 301 + minShift, 334);
  
  //body
  fill(255, 73, 165); //pink
  noStroke();
  ellipse(297 + minShift, 293, 42);
  triangle(280 + minShift, 280, 267+ minShift, 314, 297+ minShift, 314);
  push();
  fill(170, 192, 255); //lavender
  arc(298 + minShift, 293, 42, 42, -QUARTER_PI, HALF_PI, OPEN); //belly
  pop()
  //wing
  fill(240, 244, 237);
  arc(275 +minShift, 295, 43, 43, -QUARTER_PI, HALF_PI, OPEN);
  //head
    //beak
    fill(208, 216, 91); //darker yellow
    triangle (320 + minShift, 260, 320 + minShift, 271, 339 + minShift, 266);
    //head
    fill(255, 73, 165);
    ellipse(313 + minShift, 266, 23);
    //eye
    fill(234, 249, 48); //neon yellow
    ellipse(316 + minShift, 265, 6);

}

Project 06 – Abstract Clock

For my abstract clock, I chose to create an illustration of chickens in honor of a bunch of chickens I saw sitting in a pine tree the other day. I had a lot of trouble with this project because I’m still not very good at using arrays and loops yet, but I think the end result is pretty cute.

  • Random pieces of corn sprinkle per second.
  • The eating chicken moves every second and crosses the screen every minute.
  • The standing chicken moves every minute and crosses the screen every hour.
  • The background gets darker/more purple every hour into the night and lighter/more green every hour into the day.
Maggie – Abstract Clock
//Maggie Ma
//Section D

var x=0; //x position of walking chicken
var y=140; //y position of walking chicken
var eaty=40; //y position of eating chicken
var h; //hours
var m; //minutes
var s; //seconds

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

function draw() {
	
	h=hour();
	m=minute();
	s=second();

	//background changes color every hour and gets darker at night
	if(h<12) {
		background(80,20*h,50);
	} else {
		background(80,255-20*(h-12),50);
	}
	//corn that don't move
	fill(255,221,21);
	ellipse(115,376,8);
	ellipse(280,421,8);
	ellipse(422,359,8);
	ellipse(138,362,8);
	ellipse(73,301,8);
	ellipse(108,433,8);

	//chicken standing walks across screen every hour
	push();
	translate(map(m,0,60,-80,width+50), y);
	WalkingChicken();
	pop();

	//pieces of corn pop up every second
	fill(255,221,21);
	ellipse(random(3,477),random(250,477),8);
	ellipse(random(3,477),random(250,477),8);
	ellipse(random(3,477),random(250,477),8);
	ellipse(random(3,477),random(250,477),8);
	ellipse(random(3,477),random(250,477),8);

	//chicken eating walks across screen every minute
	push();
	translate(map(-s, 0,20,200,width-70), eaty);
	EatingChicken();
	pop();
}

function EatingChicken(x,y) {
	push();
	translate(x,y);
	//beak
	fill(254,183,20);
	arc(248,354,35.434,36.324,radians(150),radians(310),CHORD);
	arc(245,350,20.866,27.618,radians(-90),radians(100),CHORD);
	//feet
	stroke(254,183,20);
	strokeWeight(4);
	line(362,334,352,361);
	line(379,327,366,361);
	line(331,361,381,361);
	//crown
	noStroke();
	fill(198,56,68);
	arc(228,296,59,59.358,radians(-4),radians(150),CHORD);
	arc(241,295,30.434,33,radians(220),radians(400), CHORD);
	arc(252,290,30.434,33,radians(-90),radians(90),CHORD);
	//back tail wing
	fill(50);
	arc(359,167,101.194,111.382,radians(90),radians(270),CHORD);
	arc(368,311,43.28,42.284,radians(-40),radians(160),CHORD);
	//body
	fill(245); 
	arc(297,247,213,199,radians(320),radians(130),CHORD);
	circle(250,335,40);
	//front wing
	fill(50);
	arc(320,253,110.751,111.427,radians(320),radians(130),CHORD);
	//front tail wing
	fill(245);
	arc(391,176,98.952,95.477, radians(135),radians(-45),CHORD);
	arc(353,320,43.299,45.877,radians(-20),radians(160),CHORD);
	triangle(264,349,264,334,288,341);
	//gobbler thing
	fill(198,56,68);
	ellipse(273,353,15.903,15.903);
	triangle(252,354,271,361,271,345);
	//eye
	fill(0);
	circle(244,347,4.771);
	pop();
}

function WalkingChicken(x,y) {
	push();
	translate(x,y);
	//crown
	fill(198,56,68);
	arc(34,-105,46,43,radians(-4),radians(150),CHORD);
	arc(29,-93,40,36,radians(100),radians(-80), CHORD);
	arc(19,-95,40,37,radians(45),radians(225),CHORD);
	//beak
	fill(254,183,20);
	arc(44,-61,30.1,26.455,radians(180),radians(360),CHORD);
	arc(39,-64,30.1,16,radians(0),radians(180),CHORD);
	//feet
	stroke(254,183,20);
	strokeWeight(4);
	line(0,90,0,134);
	line(-12,134,16,134);
	line(15,78,44,78);
	line(44,78,45,100);
	line(45,100,32,109);
	line(32,109,25,103);
	//back tail
	noStroke();
	fill(231,231,233);
	arc(-65,-19,105,102.244,radians(225),radians(405),CHORD);
	//body
	fill(209,210,212);
	arc(0,0,156,163,radians(0),radians(180),CHORD); //234,229
	arc(2,6,151,150, radians(-90),radians(90),CHORD);
	rect(2,-88,45,30,10);
	arc(0,76,44,40,radians(-20),radians(190),CHORD);
	//tail
	arc(-79,6,95.1,91.244,radians(180),radians(360),CHORD);
	//front wing
	fill(231,231,233);
	arc(-3,12,102,102.244,radians(0), radians(180),CHORD);
	//gobbler
	fill(198,56,68);
	ellipse(44,-44,16,16);
	triangle(36,-43,43,-64,52,-43);
	//eye
	fill(0);
	ellipse(39,-69,4.771,4.771);
	pop();
}

To start, I created some sketches on paper, then created my chickens in Illustrator.

Left: My initial sketches
Right: My vector illustrations in Illustrator

11:30 PM : The background is a dark purple.
10:10 AM: The background is a bright green.
9:42 PM: The background is a muted dark green.

Project 06 – Abstract Clock

sketch
/*
 * Eric Zhao
 * ezhao2@andrew.cmu.edu
 *
 * Abstract clock that represents time indirectly
 * through proximity to base units (for ex. if a minute
 * is close to elapsing). The background color indicates
 * the approximate hour and time of day.
 *
 */


var x;
var y ;
var thetaSec;
var thetaMin;
var secondRad = 75;
var minuteRad = 175;
var speedMult; //rate of acceleration
var baseSpeed = 2; //speed of circles at [time unit] = 0;

function setup() {
    thetaSec = -PI;
    thetaMin = -PI;
    thetaHour = -PI;
    createCanvas(600, 600);
    background(220);
    frameRate(60);
}

function draw() {
    //draws the revolving circles and background
    push();
    translate(300, 300);
    BG();
    secondHand();
    minuteHand();
    pop();
}

function secondHand(){
    /*the "hand" is the inner circle that exponentially
    revolves faster as the seconds count grows
    closer to a minute exactly, then resets to the
    base speed when the seconds count goes back to zero. */
    speedMult = pow(second(), 1.75) / 150;
    x = secondRad * cos(radians(thetaSec));
    y = secondRad * sin(radians(thetaSec));
    circle(x, y, 50);
    thetaSec += baseSpeed + speedMult;
    print(speedMult + baseSpeed);
}

function minuteHand(){
    //see comment in secondHand(), works the same but by min/hour.
    speedMult = pow(minute(), 1.75) / 200;
    x = minuteRad * cos(radians(thetaMin));
    y = minuteRad * sin(radians(thetaMin));
    circle(x, y, 50);
    thetaMin += baseSpeed + speedMult;
    print(speedMult + baseSpeed);
}

function BG(){
    //draws a background with a fill color proportional to time.
    let fillR = map(hour(), 0, 11, 30, 255);
    let fillG = map(hour(), 0, 11, 45, 235);
    let fillB = map(hour(), 0, 11, 70, 150);

    if(hour() >= 12){
        fillR = map(24-hour(), 1, 12, 30, 255);
        fillG = map(24-hour(), 1, 12, 45, 235);
        fillB = map(24-hour(), 1, 12, 70, 150);
    }

    background(fillR, fillG, fillB);
    /*Fill conditions:
     *Goes from dark blue to pale yellow if 0 < hour < 12
     *Goes from pale yellow to dark blue if 12 >= hour > 24 
     */

    if(fillR > 190) {
        stroke(39, 58, 115);
        fill(39, 58, 115, 65);
    } else {
        stroke(255);
        fill(255, 65);
    }
    //changes stroke to dark/light based on brightness of background
    
    circle(0, 0, secondRad*2);
    circle(0, 0, minuteRad*2);
}






I was inspired by mob spawners in Minecraft when making this clock. The mob models in spawners spin faster and faster until a mob spawns from it, then it slows down and starts speeding up again until the next mob spawns.

This clock shows how close the next minute is to passing and how soon the next hour will pass, rather than displaying the exact time. The circles rotating the center speed up exponentially as the time nears the next unit. The outer circle represents minutes/hour and the inner one represents seconds/minute. The background also changes color across a gradient every hour (see code comments).


Daytime hours
Nighttime colors

Project 06 Abstract Clock

sketch

var c; //color
var hourcolor; //color of the hour flower
var mincolor; //color of the minute flower
var seccolor; //color of the second flower
var wintercolor = '#ffffff'; //color of the winter ground
var springcolor = '#c6ed4c'; //color of the spring ground
var summercolor = '#29d359'; //color of the summer ground
var fallcolor = '#f26f16'; //color fo the fall ground

function setup() {
    createCanvas(480, 480);
    hourcolor = color(255,72,72,200); //red
    mincolor = color(255,46,131,200); //pink
    seccolor = color(123,52,214,200); //purple

}

function draw() {
  background('#5e99ef'); //blue sky
  push();
  flower(110,320-10*hour(),hourcolor); //hour flower 
  pop();
  push();
  flower(230,320-4*minute(),mincolor); //minute flower
  pop();
  push();
  flower(350,320-4*second(),seccolor); //second flower
  pop();
  
  noStroke();
  if (month() > 2 & month() <= 5) { //when it is spring--March, April, May 
    fill(springcolor);
    rect(0,width-70,width,70);
  } else if (month() > 5 & month() <= 8  ) { //when it is summer--June, July, August
    fill(summercolor);
    rect(0,width-70,width,70);
  } else if (month() > 8 & month() <= 11) { //when it is fall--September, October, November
    fill(fallcolor);
    rect(0,width-70,width,70);
  } else { //when it is winter--December, January, February
    fill(wintercolor);
    rect(0,width-70,width,70);
  }
}

function flower(x,y,c) { //flower structure
  translate(x,y);
  noStroke();
  fill('#86e55a'); //green
  rect(-2,0,5,500); //flower stem
  ellipse(-10,100,20,10); //stem leaf
  ellipse(10,150,20,10); //stem leaf
  ellipse(-10,200,20,10); //stem leaf
  ellipse(10,250,20,10); //stem leaf
  fill(c);
  for (var i = 0; i < 5; i ++) { //flower petals
    ellipse(0, 0, 20, 70);
    rotate(PI/5);
  }
  fill('#ffd961'); //yellow
  ellipse(0,0,30,30); //flower middle circle
}