diff --git a/Hexclock/hexclock.py b/Hexclock/hexclock.py new file mode 100644 index 0000000..0874daa --- /dev/null +++ b/Hexclock/hexclock.py @@ -0,0 +1,48 @@ +import math +import tkinter +import time + +SHIFT_SPEED = 0.2 + +degree = 359 +r = 0 +g = 0 +b = 0 + +def cval(degree, hueshift): + y = math.sin(math.pi*(degree+hueshift)/180) + # Anything above 50% becomes 100% + # 0 - 50% will scale as if it was 50 - 100% + y = (y+0.5) * 256 + y = min(255, y) + y = max(0, y) + y = round(y) + return y + +def clocking(): + x = time.time() + x *= SHIFT_SPEED + r = cval(x, 90) + g = cval(x, 210) + b = cval(x, 330) + rgb = '#%02x%02x%02x' % (r,g,b) + #print(x, rgb) + #t.configure(bg=rgb) + l.configure(text=rgb, bg=rgb) + t.after(50, clocking) + +t = tkinter.Tk() +l = tkinter.Label(text='') +l.pack(expand=True, fill='both') +w = 450 +h = 350 +screenwidth = t.winfo_screenwidth() +screenheight = t.winfo_screenheight() +windowwidth = w +windowheight = h +windowx = (screenwidth-windowwidth) / 2 +windowy = ((screenheight-windowheight) / 2) - 27 +geometrystring = '%dx%d+%d+%d' % (windowwidth, windowheight, windowx, windowy) +t.geometry(geometrystring) +clocking() +t.mainloop() \ No newline at end of file diff --git a/Trash/hexemblem.svg b/Trash/hexemblem.svg index e81c13e..7b1ec3f 100644 --- a/Trash/hexemblem.svg +++ b/Trash/hexemblem.svg @@ -28,9 +28,9 @@ borderopacity="1.0" inkscape:pageopacity="0.0" inkscape:pageshadow="2" - inkscape:zoom="0.25" - inkscape:cx="100.54841" - inkscape:cy="407.95322" + inkscape:zoom="1" + inkscape:cx="379.35693" + inkscape:cy="763.59064" inkscape:document-units="px" inkscape:current-layer="layer1" showgrid="false" @@ -60,7 +60,7 @@ style="opacity:1">