Files
OrbitTv/design/interface/build-settings-icons.py
T
pauljdandClaude Opus 5.5 e72a0f12a4
pauljd/davidson-ci: Davidson CI / quality (push) Failing after 4m18s
pauljd/davidson-ci: Davidson CI / ai-review (push) Failing after 1m52s
release-gate / verify (push) Successful in 11m14s
0.129 P3: EffectCraft switch motion, VectorCraft Settings icons, FigCraft layout prototypes
- Switches slide in 160 ms on Orbit's curve (designed in EffectCraft, design/motion/switch); Reduce motion: no slide, 120 ms fade.
  The setting changes on the press; the animation never holds it up.
- Family, Rooms (TV and phone) and Account get their own icons (design/interface/build-settings-icons.py)
- Orbit Simple and Retro Cable prototypes for approval (design/layouts), not in the app

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
2026-11-10 21:03:08 +00:00

41 lines
2.4 KiB
Python

"""Settings rail icons for 0.129 stage 3 (Paul, 10 November 2026: Rooms gets a TV-and-phone icon, and Account and Family stop
sharing one person). Same family as the other Orbit icons: 96 px artboard, silver line or fill, round joins, 5 px strokes;
the app tints them. VectorCraft makes the editable .vectorcraft and the PNG; the app takes a lossless WebP.
Run: python3 design/interface/build-settings-icons.py
"""
import os
import subprocess
from pathlib import Path
from PIL import Image
HERE = Path(__file__).resolve().parent
ROOT = HERE.parents[1]
OUT = HERE / 'icons'
RES = ROOT / 'android/app/src/main/res/drawable-nodpi'
ENV = dict(os.environ, XDG_DATA_HOME=str(ROOT.parent / 'orbit-tv/.tooling/font-data'))
C = '#E8EDF5'
S = f'fill="none" stroke="{C}" stroke-width="5" stroke-linecap="round" stroke-linejoin="round"'
ICONS = {
# A TV and, beside it, a phone: other rooms' TVs and the phones paired to this one.
'rooms': f'<rect x="6" y="18" width="54" height="38" rx="6" {S}/><path d="M22 68H44M33 56V68" {S}/>'
f'<rect x="66" y="30" width="24" height="52" rx="5" {S}/><path d="M74 74H82" {S}/>',
# Two people, a grown-up and a child: who watches.
'family': f'<circle cx="32" cy="28" r="14" fill="{C}"/><path d="M6 84C6 62 17 52 32 52S58 62 58 84Z" fill="{C}"/>'
f'<circle cx="75" cy="46" r="10" fill="{C}"/><path d="M63 84C63 71 68 64 75 64S89 71 89 84Z" fill="{C}"/>',
# The server: two stacked units with their lights, and a link down to this box.
'account': f'<rect x="14" y="12" width="68" height="26" rx="6" {S}/><rect x="14" y="44" width="68" height="26" rx="6" {S}/>'
f'<circle cx="28" cy="25" r="4" fill="{C}"/><circle cx="28" cy="57" r="4" fill="{C}"/><path d="M44 25H68M44 57H68" {S}/>'
f'<path d="M48 70V86M34 86H62" {S}/>',
}
for name, body in ICONS.items():
svg = OUT / f'orbit_icon_{name}.svg'
svg.write_text(f'<svg xmlns="http://www.w3.org/2000/svg" width="96" height="96" viewBox="0 0 96 96">{body}</svg>')
for out, options in ((svg.with_suffix('.vectorcraft'), []), (svg.with_suffix('.png'), [])):
subprocess.run(['vectorcraft-cli', 'convert', str(svg), str(out), *options], env=ENV, check=True, stdout=subprocess.DEVNULL)
Image.open(svg.with_suffix('.png')).convert('RGBA').resize((96, 96), Image.LANCZOS).save(RES / f'orbit_icon_{name}.webp', lossless=True)
print('made', name)