mjanco – project6-abstractclock-sectionB

abstractclock

//Michelle Janco
//Section B
//mjanco@andrew.cmu.edu
//Project06-AbstractClock

function setup() {
  createCanvas(600, 800);
}

function draw() {
  noStroke();
  background(228,200,30);

  var mapH = map(hour(), 0,30, 0, width);

//make ellipse that grows depending on the hour
  fill(250, 150, 0);
    ellipse(300,400, mapH, 50);


  for (var i = 0; i < 60; i++){
    var c = color(240, 200, 0);
    	//make seconds red
    	if (second() == i) {
      	c = color(240, 80, 30);
    }
    //if not, purple
    else {
      	c = color(130, 100, 180);

    //getting the minutes to gradually make the clock green as time goes on
    	if (i < minute() & i != second()) {
      	c = color(100, 150, 30);
     	 }
 	 }
    drawMark(i, c);
  }
}
  function drawMark(count, col) {
    push();
    translate(300, 400);
    rotate(radians(count*6));
    fill(col);
    strokeWeight(1);
    ellipse(50,50, 300,3);
    pop();
  }

For this assignment, I was inspired by wacky 60’s / 70’s room accessories, with their bright colors and abstract shapes. It took me a while to figure out how to make the minutes add up and then reset once 60 minutes pass, but eventually i figured it out, and learned a lot from doing this project.

Leave a Reply