/* * Title: Web Clock (noFill) * Built With Processing * * Created by Shin Nakamura (Basic Werk) * Copyright 2012 Tokyo JAPAN. All rights reserved. * */ color bgClr = color(255); //background color PFont font; void setup(){ int w = 400; //width size(w,w * 0.5); background(bgClr); smooth(); frameRate(2); //frame rate:2 per 1 second font = loadFont("Helvetica-48.vlw"); } void draw(){ background(bgClr); color arcClr = color(#041643); //arche color float arcSize = height/2; //arche size float arcStart = PI * 1.5; //start from 0 degree strokeCap(SQUARE); //arche stroke cap strokeWeight(height/20); //arche stroke weight stroke(arcClr); //arche stroke color color tClr = color(#E8A700); //text color float tSize = 48; //text size textAlign(CENTER); textFont(font, tSize); //hour noFill(); arc(width * 0.2, height * 0.5, arcSize, arcSize, arcStart, arcStart + radians(map(hour() % 12, 0, 12, 0, 360))); fill(tClr); text(hour(), width * 0.2, height * 0.5 + tSize/3); //: text(':', width * 0.35, height * 0.5 + tSize/3); //minute noFill(); arc(width * 0.5, height * 0.5, arcSize, arcSize, arcStart, arcStart + radians(map(minute(), 0, 60, 0, 360))); fill(tClr); text(minute(), width * 0.5, height * 0.5 + tSize/3); //: text(':', width * 0.65, height * 0.5 + tSize/3); //seconds noFill(); arc(width * 0.8, height * 0.5, arcSize, arcSize, arcStart, arcStart + radians(map(second(), 0, 60, 0, 360))); fill(tClr); text(second(), width * 0.8, height * 0.5 + tSize/3); }