Raif
|
2010-12-28
, 20:48
|
Posts: 94 |
Thanked: 61 times |
Joined on Feb 2010
@ Shoreham
|
#51
|
The Following User Says Thank You to Raif For This Useful Post: | ||
|
2010-12-28
, 22:11
|
Posts: 482 |
Thanked: 550 times |
Joined on Oct 2010
|
#52
|
# # Original program copyright 2010 Ruediger Gad <r.c.g@gmx.de> # Modified by Skyler Lehmkuhl # # This program is free software: you can redistribute it and/or modify # it under the terms of the GNU General Public License as published by # the Free Software Foundation, either version 3 of the License, or # (at your option) any later version. # # This program is distributed in the hope that it will be useful, # but WITHOUT ANY WARRANTY; without even the implied warranty of # MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the # GNU General Public License for more details. # # You should have received a copy of the GNU General Public License # along with this program. If not, see <http://www.gnu.org/licenses/>. # import cairo from datetime import datetime import gtk import math import clock def get_name(): return "Binary Clock with Color" class BinaryClockColor(clock.Clock): def __init__(self, drawing_area): clock.Clock.__init__(self, drawing_area) def draw_bits_horizontally(self, x, y, radius, value, n): for i in range(n): self.context.set_source_rgb(y/26.0, value/60.0, i/6.0) self.context.arc(x + (1.5 * radius) + (3 * radius * i), y + radius, radius, 0, 2 * math.pi) if (value >> (n - i - 1) & 1) > 0: self.context.fill_preserve() self.context.stroke() def draw_clock(self): if self.show_seconds : self.draw_bits_horizontally(12, 2, 4, self.time.hour, 5) self.draw_bits_horizontally(0, 14, 4, self.time.minute, 6) self.draw_bits_horizontally(0, 26, 4, self.time.second, 6) else : self.draw_bits_horizontally(18, 2, 6, self.time.hour, 5) self.draw_bits_horizontally(0, 20, 6, self.time.minute, 6) def resize(self): if self.show_seconds : self.drawing_area.set_size_request(76, 36) else: self.drawing_area.set_size_request(110, 36)
The Following 2 Users Say Thank You to skykooler For This Useful Post: | ||
|
2010-12-28
, 22:36
|
Posts: 306 |
Thanked: 106 times |
Joined on Feb 2010
|
#53
|
The Following User Says Thank You to rajil.s For This Useful Post: | ||
|
2010-12-28
, 22:46
|
Posts: 1,042 |
Thanked: 430 times |
Joined on May 2010
|
#54
|
I created a clock plugin, it is based on the binary clock but the color changes based on the time. Here is the code:
Code:# # Original program copyright 2010 Ruediger Gad <r.c.g@gmx.de> # Modified by Skyler Lehmkuhl # # This program is free software: you can redistribute it and/or modify # it under the terms of the GNU General Public License as published by # the Free Software Foundation, either version 3 of the License, or # (at your option) any later version. # # This program is distributed in the hope that it will be useful, # but WITHOUT ANY WARRANTY; without even the implied warranty of # MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the # GNU General Public License for more details. # # You should have received a copy of the GNU General Public License # along with this program. If not, see <http://www.gnu.org/licenses/>. # import cairo from datetime import datetime import gtk import math import clock def get_name(): return "Binary Clock with Color" class BinaryClockColor(clock.Clock): def __init__(self, drawing_area): clock.Clock.__init__(self, drawing_area) def draw_bits_horizontally(self, x, y, radius, value, n): for i in range(n): self.context.set_source_rgb(y/26.0, value/60.0, i/6.0) self.context.arc(x + (1.5 * radius) + (3 * radius * i), y + radius, radius, 0, 2 * math.pi) if (value >> (n - i - 1) & 1) > 0: self.context.fill_preserve() self.context.stroke() def draw_clock(self): if self.show_seconds : self.draw_bits_horizontally(12, 2, 4, self.time.hour, 5) self.draw_bits_horizontally(0, 14, 4, self.time.minute, 6) self.draw_bits_horizontally(0, 26, 4, self.time.second, 6) else : self.draw_bits_horizontally(18, 2, 6, self.time.hour, 5) self.draw_bits_horizontally(0, 20, 6, self.time.minute, 6) def resize(self): if self.show_seconds : self.drawing_area.set_size_request(76, 36) else: self.drawing_area.set_size_request(110, 36)
|
2010-12-29
, 00:33
|
Posts: 456 |
Thanked: 1,580 times |
Joined on Dec 2009
|
#55
|
The Following 2 Users Say Thank You to Wonko For This Useful Post: | ||
|
2010-12-29
, 00:38
|
Posts: 482 |
Thanked: 550 times |
Joined on Oct 2010
|
#56
|
Good idea for this...! Might as well implement this style also to BCD Clock as that's the one I use
The Following 2 Users Say Thank You to skykooler For This Useful Post: | ||
|
2010-12-29
, 00:51
|
Posts: 482 |
Thanked: 550 times |
Joined on Oct 2010
|
#57
|
|
2010-12-29
, 04:42
|
|
Posts: 335 |
Thanked: 51 times |
Joined on May 2010
|
#58
|
|
2010-12-29
, 04:48
|
Posts: 2,225 |
Thanked: 3,822 times |
Joined on Jun 2010
@ Florida
|
#59
|
|
2010-12-29
, 04:52
|
|
Posts: 335 |
Thanked: 51 times |
Joined on May 2010
|
#60
|