Compare commits
3 Commits
ddaf391a56
...
37baca6fef
Author | SHA1 | Date | |
---|---|---|---|
|
37baca6fef | ||
|
a0baee69f8 | ||
|
64e6d7242c |
3
.gitignore
vendored
3
.gitignore
vendored
@@ -1 +1,2 @@
|
||||
*.png
|
||||
*.png
|
||||
*.pyc
|
@@ -5,6 +5,8 @@ from PIL import Image
|
||||
from PIL import ImageDraw
|
||||
from PIL import ImageFont
|
||||
|
||||
mirror = False
|
||||
|
||||
|
||||
def rgb(r=0, g=None, b=None):
|
||||
if g == None:
|
||||
@@ -19,10 +21,12 @@ def rrc(tuple, center, angle):
|
||||
cos = math.cos(angle)
|
||||
tpl = (tuple[0] - center[0], tuple[1] - center[1])
|
||||
tpl = tuple
|
||||
if mirror:
|
||||
cos = -cos
|
||||
return (int(tpl[0] * sin + tpl[1] * cos + center[0]), int(-tpl[0] * cos + tpl[1] * sin + center[1]))
|
||||
|
||||
|
||||
def draw_clock(size=(800, 480), pixelformat="RGBA", r=210, aliasing=None):
|
||||
def draw_clock(size=(800, 480), pixelformat="RGBA", r=230, aliasing=None):
|
||||
if aliasing != None:
|
||||
size = (size[0] * aliasing, size[1] * aliasing)
|
||||
r *= aliasing
|
||||
@@ -37,7 +41,7 @@ def draw_clock(size=(800, 480), pixelformat="RGBA", r=210, aliasing=None):
|
||||
for i12 in range(12):
|
||||
for i5 in range(5):
|
||||
angle = (i12 * 5 + i5) / 60 * 2 * math.pi
|
||||
len = r * 0.93 if i5 == 0 else r * 0.97
|
||||
len = r * 0.85 if i5 == 0 else r * 0.95
|
||||
thick = int((5 if i5 == 0 else 2) * r/180)
|
||||
sin = math.sin(angle)
|
||||
cos = math.cos(angle)
|
||||
|
Reference in New Issue
Block a user