This was created back on 2014 as a PCG question. See more of that here.
It is a clock that changes its colors accordingly to the hour of day, showing local time. As the time passes, it will slowly change it colors, using brighter colors at day and darker colors at night.
The window is resizable and the clock will resize automatically to whatever size you choose.
Further, if the user adjusts the system clock or if a daylight time change happens, the clock will automatically reflect that.
There are two forms to run it:
java clock.ClockDemo. This will open a window and you will see the clock there.
java clock.ClockSave filename width height [HH:mm:ss]. This will just save the clock in a PNG file with the given file name, width and height. The clock will be draw with the given time, or if that is omitted, with current time. For example, if you run it as
java clock.ClockSave clock.png 600 500 12:38:24it will save the clock in a 600x500 image in a
clock.pngfile and the clock will be showing 12:38:24 AM. Use hours in the 00-23 interval.
Here are some screenshots and generated files: