Import GingerCal 1.0 source

This commit is contained in:
xocko committed 2026-10-15 16:35:05 +02:00
commit 01f49852ab
116 files changed
+5079

No files matched your search

+31
View File
@@ -0,0 +1,31 @@
#!/usr/bin/env python3
"""Draws the 48x48 (mdpi) launcher icon: a little calendar page in ginger tones."""
import sys
from PIL import Image, ImageDraw
S = 4 # supersample then shrink for smooth edges
W = 48 * S
img = Image.new("RGBA", (W, W), (0, 0, 0, 0))
d = ImageDraw.Draw(img)
# shadow
d.rounded_rectangle((5 * S, 7 * S, 45 * S, 46 * S), radius=6 * S, fill=(0, 0, 0, 90))
# page
d.rounded_rectangle((3 * S, 5 * S, 43 * S, 44 * S), radius=6 * S, fill=(250, 246, 238, 255))
# ginger header band
d.rounded_rectangle((3 * S, 5 * S, 43 * S, 17 * S), radius=6 * S, fill=(214, 110, 42, 255))
d.rectangle((3 * S, 11 * S, 43 * S, 17 * S), fill=(214, 110, 42, 255))
# binder rings
for x in (13, 33):
d.rounded_rectangle(((x - 2) * S, 2 * S, (x + 2) * S, 10 * S), radius=2 * S, fill=(90, 60, 40, 255))
# day grid, one day highlighted
for row in range(3):
for col in range(4):
x0 = (8 + col * 8.5) * S
y0 = (21 + row * 7.5) * S
box = (x0, y0, x0 + 5.5 * S, y0 + 5 * S)
if (row, col) == (1, 2):
d.rounded_rectangle(box, radius=1.5 * S, fill=(0, 130, 201, 255)) # Nextcloud blue
else:
d.rounded_rectangle(box, radius=1.5 * S, fill=(200, 188, 172, 255))
img = img.resize((48, 48), Image.LANCZOS)
img.save(sys.argv[1] if len(sys.argv) > 1 else "icon.png", optimize=True)