"""The station's drawn textures (python, PIL), after the picture: python cs_textures.py -> ../textures/T_CS_Radiation.png, T_CS_Screen_UI.png, T_CS_GlowRing.png T_CS_Radiation the radiation sign on the canister (RGBA, 1024): a yellow disc, black trefoil turned as in the picture (blades up-left, up-right and down), a thin darker rim; transparent outside the disc T_CS_Screen_UI the small status screen (1024): a dark glass with a rising bar chart, a ring gauge and a few readout lines, teal as in the picture; generic, no text that names anything T_CS_GlowRing the cap's light ring along its circumference (512 x 16): cyan at the top and bottom of the canister, pale lime on its sides (the picture's colours, sampled) """ import math, os from PIL import Image, ImageDraw, ImageFilter HERE = os.path.dirname(os.path.abspath(__file__)) TEX = os.path.join(os.path.dirname(HERE), "textures") os.makedirs(TEX, exist_ok=True) def radiation(N=1024): ss = 4 S = N * ss im = Image.new("RGBA", (S, S), (0, 0, 0, 0)) d = ImageDraw.Draw(im) c = S / 2 R = S * 0.49 yellow, rim, black = (255, 214, 40, 255), (196, 150, 18, 255), (24, 22, 20, 255) d.ellipse([c - R, c - R, c + R, c + R], fill=rim) R2 = R * 0.965 d.ellipse([c - R2, c - R2, c + R2, c + R2], fill=yellow) r = R * 0.165 # centre dot; blades from 1.5 r to 4.9 r, 60 degrees wide for a in (30, 150, 270): # picture angles (counter-clockwise from right, v up) pts = [] for k in range(41): t = math.radians(a - 30 + 60 * k / 40) pts.append((c + 4.9 * r * math.cos(t), c - 4.9 * r * math.sin(t))) for k in range(41): t = math.radians(a + 30 - 60 * k / 40) pts.append((c + 1.5 * r * math.cos(t), c - 1.5 * r * math.sin(t))) d.polygon(pts, fill=black) d.ellipse([c - r, c - r, c + r, c + r], fill=black) im = im.resize((N, N), Image.LANCZOS) im.save(os.path.join(TEX, "T_CS_Radiation.png")) def screen(N=1024): ss = 2 S = N * ss im = Image.new("RGB", (S, S), (14, 22, 24)) d = ImageDraw.Draw(im) teal, dim, pale = (40, 200, 175), (24, 92, 88), (120, 230, 210) # a faint frame and a header line d.rectangle([S * 0.04, S * 0.04, S * 0.96, S * 0.96], outline=(30, 52, 54), width=6) d.rectangle([S * 0.08, S * 0.08, S * 0.40, S * 0.105], fill=dim) for k in range(3): # small round indicators down the left (the picture has three) y = S * (0.16 + 0.10 * k) d.ellipse([S * 0.07, y, S * 0.13, y + S * 0.06], outline=dim, width=6) # bar chart, rising x0, y1 = S * 0.20, S * 0.50 hs = [0.06, 0.09, 0.08, 0.12, 0.15, 0.13, 0.19, 0.24, 0.30, 0.36] for k, h in enumerate(hs): x = x0 + k * S * 0.034 d.rectangle([x, y1 - h * S, x + S * 0.022, y1], fill=teal if k > 2 else dim) d.line([(x0, y1 + 6), (x0 + 10 * S * 0.034, y1 + 6)], fill=dim, width=4) # trend line over the bars pts = [(x0 + k * S * 0.034 + S * 0.011, y1 - h * S - S * 0.03) for k, h in enumerate(hs)] d.line(pts, fill=pale, width=6) # ring gauge cx, cy, R = S * 0.78, S * 0.30, S * 0.14 d.ellipse([cx - R, cy - R, cx + R, cy + R], outline=(26, 60, 60), width=int(S * 0.04)) d.arc([cx - R, cy - R, cx + R, cy + R], start=-90, end=200, fill=teal, width=int(S * 0.04)) for k in range(3): d.rectangle([cx - R * 0.35, cy - R * 0.3 + k * R * 0.25, cx + R * 0.35, cy - R * 0.2 + k * R * 0.25], fill=dim) # readout lines and a sparkline area at the bottom for k, w in enumerate((0.42, 0.30, 0.36, 0.22)): y = S * (0.58 + 0.045 * k) d.rectangle([S * 0.10, y, S * (0.10 + w), y + S * 0.018], fill=teal if k == 0 else dim) pts, base = [], S * 0.90 for k in range(60): x = S * (0.10 + 0.80 * k / 59) y = base - S * (0.04 + 0.05 * abs(math.sin(k * 0.37)) * (0.6 + 0.4 * math.sin(k * 0.11))) pts.append((x, y)) d.polygon(pts + [(S * 0.90, base), (S * 0.10, base)], fill=(20, 60, 58)) d.line(pts, fill=teal, width=5) im = im.filter(ImageFilter.GaussianBlur(1.2)).resize((N, N), Image.LANCZOS) im.save(os.path.join(TEX, "T_CS_Screen_UI.png")) def glow(W=512, H=16): cyan, lime = (119, 196, 230), (214, 236, 160) im = Image.new("RGB", (W, H)) for x in range(W): th = 2 * math.pi * (x + 0.5) / W # 0 at the canister's top, 90 degrees its near side k = math.sin(th) ** 2 col = tuple(int(round(a + (b - a) * k)) for a, b in zip(cyan, lime)) for y in range(H): im.putpixel((x, y), col) im.save(os.path.join(TEX, "T_CS_GlowRing.png")) radiation() screen() glow() print("TEXTURES OK")