Janet Lee- Project-06-Abstract Clock

sketch

//Janet Lee
//Section C
//janetl2@andrew.cmu.edu
//Project 06 - Abstract Clock
function setup() {
    createCanvas(600, 600);


}

function draw() {

  background("#79A1BF");

  push();
  translate(width / 2, height / 2);
  fill("#6748A4");
  rotate(radians(hour()%12*30))
  rectMode(CENTER);
  rect(0, 0, 300, 300);
  pop();

  push();
  translate(width / 2, height / 2);
  fill(" #FFEF80");
  rotate(radians(minute()/5*30));
  rectMode(CENTER);
  rect(0, 0, 250, 250);
  pop();

  push();
  translate(width / 2, height / 2);
  fill(" #F05E85");
  rotate(radians (second()*6));
  rectMode(CENTER);
  rect(0, 0, 100, 100);
  pop();

  var h = hour();
  var m = minute();
  var s = second();
  text(h%12,260,50);
  text(":" + m,300,50);
  text(":" + s, 340,50);

    }

Leave a Reply