diff --git a/CHANGELOG.md b/CHANGELOG.md index fabc43b..9d71c09 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -20,6 +20,9 @@ Alle nennenswerten Änderungen an diesem Projekt. Format nach - (build) Version 0.7.1 (8): Splash-Kette, sonst identisch zu 0.7.0; signiertes App Bundle mit Upload-Keystore ### Added +- (art) Generierte Marken-Grafik: `tools/art/` (SVG-Master + rsvg), Adaptive Icon inkl. + Monochrom, Splash-Lockup, neues Feature-Graphic, Design-Tokens nach + `app/lib/src/ui/palette.dart`; Doku in `docs/art-direction.md` - (app) Splash-Kette ohne weissen Bildschirm: Markenfarbe `#05070A` als Launch- und Normal-Theme, Android-12-Splash-API (`values-v31`), pulsierendes Logo inkl. Fortschrittslinie bis die native Bibliothek, die Session und das Ad-SDK bereit sind, danach Fade in die Partie diff --git a/app/android/app/src/main/res/drawable-xxxhdpi/launch_logo.png b/app/android/app/src/main/res/drawable-xxxhdpi/launch_logo.png index 540034c..069eece 100644 Binary files a/app/android/app/src/main/res/drawable-xxxhdpi/launch_logo.png and b/app/android/app/src/main/res/drawable-xxxhdpi/launch_logo.png differ diff --git a/app/android/app/src/main/res/drawable-xxxhdpi/launch_logo_splash.png b/app/android/app/src/main/res/drawable-xxxhdpi/launch_logo_splash.png index 88546ea..7174203 100644 Binary files a/app/android/app/src/main/res/drawable-xxxhdpi/launch_logo_splash.png and b/app/android/app/src/main/res/drawable-xxxhdpi/launch_logo_splash.png differ diff --git a/app/android/app/src/main/res/mipmap-anydpi-v26/ic_launcher.xml b/app/android/app/src/main/res/mipmap-anydpi-v26/ic_launcher.xml new file mode 100644 index 0000000..ace5cf7 --- /dev/null +++ b/app/android/app/src/main/res/mipmap-anydpi-v26/ic_launcher.xml @@ -0,0 +1,7 @@ + + + + + + + diff --git a/app/android/app/src/main/res/mipmap-anydpi-v26/ic_launcher_round.xml b/app/android/app/src/main/res/mipmap-anydpi-v26/ic_launcher_round.xml new file mode 100644 index 0000000..ace5cf7 --- /dev/null +++ b/app/android/app/src/main/res/mipmap-anydpi-v26/ic_launcher_round.xml @@ -0,0 +1,7 @@ + + + + + + + diff --git a/app/android/app/src/main/res/mipmap-hdpi/ic_launcher.png b/app/android/app/src/main/res/mipmap-hdpi/ic_launcher.png index db77bb4..f0b860f 100644 Binary files a/app/android/app/src/main/res/mipmap-hdpi/ic_launcher.png and b/app/android/app/src/main/res/mipmap-hdpi/ic_launcher.png differ diff --git a/app/android/app/src/main/res/mipmap-hdpi/ic_launcher_background.png b/app/android/app/src/main/res/mipmap-hdpi/ic_launcher_background.png new file mode 100644 index 0000000..c9f467d Binary files /dev/null and b/app/android/app/src/main/res/mipmap-hdpi/ic_launcher_background.png differ diff --git a/app/android/app/src/main/res/mipmap-hdpi/ic_launcher_foreground.png b/app/android/app/src/main/res/mipmap-hdpi/ic_launcher_foreground.png new file mode 100644 index 0000000..135e5b2 Binary files /dev/null and b/app/android/app/src/main/res/mipmap-hdpi/ic_launcher_foreground.png differ diff --git a/app/android/app/src/main/res/mipmap-hdpi/ic_launcher_monochrome.png b/app/android/app/src/main/res/mipmap-hdpi/ic_launcher_monochrome.png new file mode 100644 index 0000000..3d1ee1c Binary files /dev/null and b/app/android/app/src/main/res/mipmap-hdpi/ic_launcher_monochrome.png differ diff --git a/app/android/app/src/main/res/mipmap-mdpi/ic_launcher.png b/app/android/app/src/main/res/mipmap-mdpi/ic_launcher.png index 17987b7..11a55a9 100644 Binary files a/app/android/app/src/main/res/mipmap-mdpi/ic_launcher.png and b/app/android/app/src/main/res/mipmap-mdpi/ic_launcher.png differ diff --git a/app/android/app/src/main/res/mipmap-mdpi/ic_launcher_background.png b/app/android/app/src/main/res/mipmap-mdpi/ic_launcher_background.png new file mode 100644 index 0000000..ede2c6c Binary files /dev/null and b/app/android/app/src/main/res/mipmap-mdpi/ic_launcher_background.png differ diff --git a/app/android/app/src/main/res/mipmap-mdpi/ic_launcher_foreground.png b/app/android/app/src/main/res/mipmap-mdpi/ic_launcher_foreground.png new file mode 100644 index 0000000..153fbec Binary files /dev/null and b/app/android/app/src/main/res/mipmap-mdpi/ic_launcher_foreground.png differ diff --git a/app/android/app/src/main/res/mipmap-mdpi/ic_launcher_monochrome.png b/app/android/app/src/main/res/mipmap-mdpi/ic_launcher_monochrome.png new file mode 100644 index 0000000..07c8c04 Binary files /dev/null and b/app/android/app/src/main/res/mipmap-mdpi/ic_launcher_monochrome.png differ diff --git a/app/android/app/src/main/res/mipmap-xhdpi/ic_launcher.png b/app/android/app/src/main/res/mipmap-xhdpi/ic_launcher.png index 09d4391..3ffd6d1 100644 Binary files a/app/android/app/src/main/res/mipmap-xhdpi/ic_launcher.png and b/app/android/app/src/main/res/mipmap-xhdpi/ic_launcher.png differ diff --git a/app/android/app/src/main/res/mipmap-xhdpi/ic_launcher_background.png b/app/android/app/src/main/res/mipmap-xhdpi/ic_launcher_background.png new file mode 100644 index 0000000..aa716e4 Binary files /dev/null and b/app/android/app/src/main/res/mipmap-xhdpi/ic_launcher_background.png differ diff --git a/app/android/app/src/main/res/mipmap-xhdpi/ic_launcher_foreground.png b/app/android/app/src/main/res/mipmap-xhdpi/ic_launcher_foreground.png new file mode 100644 index 0000000..83b15d8 Binary files /dev/null and b/app/android/app/src/main/res/mipmap-xhdpi/ic_launcher_foreground.png differ diff --git a/app/android/app/src/main/res/mipmap-xhdpi/ic_launcher_monochrome.png b/app/android/app/src/main/res/mipmap-xhdpi/ic_launcher_monochrome.png new file mode 100644 index 0000000..713c2be Binary files /dev/null and b/app/android/app/src/main/res/mipmap-xhdpi/ic_launcher_monochrome.png differ diff --git a/app/android/app/src/main/res/mipmap-xxhdpi/ic_launcher.png b/app/android/app/src/main/res/mipmap-xxhdpi/ic_launcher.png index d5f1c8d..44ce835 100644 Binary files a/app/android/app/src/main/res/mipmap-xxhdpi/ic_launcher.png and b/app/android/app/src/main/res/mipmap-xxhdpi/ic_launcher.png differ diff --git a/app/android/app/src/main/res/mipmap-xxhdpi/ic_launcher_background.png b/app/android/app/src/main/res/mipmap-xxhdpi/ic_launcher_background.png new file mode 100644 index 0000000..93c4b5a Binary files /dev/null and b/app/android/app/src/main/res/mipmap-xxhdpi/ic_launcher_background.png differ diff --git a/app/android/app/src/main/res/mipmap-xxhdpi/ic_launcher_foreground.png b/app/android/app/src/main/res/mipmap-xxhdpi/ic_launcher_foreground.png new file mode 100644 index 0000000..04ee942 Binary files /dev/null and b/app/android/app/src/main/res/mipmap-xxhdpi/ic_launcher_foreground.png differ diff --git a/app/android/app/src/main/res/mipmap-xxhdpi/ic_launcher_monochrome.png b/app/android/app/src/main/res/mipmap-xxhdpi/ic_launcher_monochrome.png new file mode 100644 index 0000000..76aad6d Binary files /dev/null and b/app/android/app/src/main/res/mipmap-xxhdpi/ic_launcher_monochrome.png differ diff --git a/app/android/app/src/main/res/mipmap-xxxhdpi/ic_launcher.png b/app/android/app/src/main/res/mipmap-xxxhdpi/ic_launcher.png index 4d6372e..1249e01 100644 Binary files a/app/android/app/src/main/res/mipmap-xxxhdpi/ic_launcher.png and b/app/android/app/src/main/res/mipmap-xxxhdpi/ic_launcher.png differ diff --git a/app/android/app/src/main/res/mipmap-xxxhdpi/ic_launcher_background.png b/app/android/app/src/main/res/mipmap-xxxhdpi/ic_launcher_background.png new file mode 100644 index 0000000..09d4fa9 Binary files /dev/null and b/app/android/app/src/main/res/mipmap-xxxhdpi/ic_launcher_background.png differ diff --git a/app/android/app/src/main/res/mipmap-xxxhdpi/ic_launcher_foreground.png b/app/android/app/src/main/res/mipmap-xxxhdpi/ic_launcher_foreground.png new file mode 100644 index 0000000..c4d538f Binary files /dev/null and b/app/android/app/src/main/res/mipmap-xxxhdpi/ic_launcher_foreground.png differ diff --git a/app/android/app/src/main/res/mipmap-xxxhdpi/ic_launcher_monochrome.png b/app/android/app/src/main/res/mipmap-xxxhdpi/ic_launcher_monochrome.png new file mode 100644 index 0000000..0edc425 Binary files /dev/null and b/app/android/app/src/main/res/mipmap-xxxhdpi/ic_launcher_monochrome.png differ diff --git a/app/android/app/src/main/res/values/colors.xml b/app/android/app/src/main/res/values/colors.xml index 340af42..92ddda2 100644 --- a/app/android/app/src/main/res/values/colors.xml +++ b/app/android/app/src/main/res/values/colors.xml @@ -2,7 +2,7 @@ #FF05070A - - #FF0B1220 + + #FF05070A diff --git a/app/assets/logo_mark.png b/app/assets/logo_mark.png index 540034c..b8c4870 100644 Binary files a/app/assets/logo_mark.png and b/app/assets/logo_mark.png differ diff --git a/app/lib/src/ui/palette.dart b/app/lib/src/ui/palette.dart new file mode 100644 index 0000000..c3800b4 --- /dev/null +++ b/app/lib/src/ui/palette.dart @@ -0,0 +1,43 @@ +// GENERATED FILE - do not edit by hand. +// Source: tools/art/palette.json, generator: tools/art/artgen.py +// Re-run `python3 tools/art/artgen.py palette` after changing a token. + +import 'package:flutter/material.dart'; + +/// Design tokens shared by the app and the generated art. +abstract final class Palette { + + // ink + static const ink0 = Color(0xFF05070A); + static const ink1 = Color(0xFF0A1220); + static const ink2 = Color(0xFF101B2E); + static const ink3 = Color(0xFF1B2C44); + + // solar + static const solarLight = Color(0xFFFFD9A0); + static const solarBase = Color(0xFFFFB347); + static const solarDeep = Color(0xFFFF7A2F); + + // steel + static const steelLight = Color(0xFF9FE3F0); + static const steelBase = Color(0xFF4EA8C8); + static const steelDeep = Color(0xFF2C6F8A); + + // terrain + static const terrainRim = Color(0xFFE8C08A); + static const terrainTop = Color(0xFF7A6A45); + static const terrainSoil = Color(0xFF3A2F20); + static const terrainDeep = Color(0xFF241C12); + + // state + static const stateDanger = Color(0xFFFF5A5F); + static const stateOk = Color(0xFF6BD08A); + + // text + static const textHi = Color(0xFFF5F7FA); + static const textMid = Color(0xFFA9B4C4); + static const textLow = Color(0xFF6C7A8D); + + // type + +} diff --git a/app/lib/src/ui/splash_screen.dart b/app/lib/src/ui/splash_screen.dart index db5b77c..c3e9b91 100644 --- a/app/lib/src/ui/splash_screen.dart +++ b/app/lib/src/ui/splash_screen.dart @@ -1,5 +1,7 @@ import 'package:flutter/material.dart'; +import 'palette.dart'; + /// Brand splash shown while the native match library, the session and the /// ad SDK boot. The logo pulses so a cold start reads as "loading" instead of /// a frozen screen - the native launch theme uses the same colour and image, @@ -8,8 +10,8 @@ class SplashScreen extends StatefulWidget { const SplashScreen({super.key}); /// Canvas colour of the game; the Android launch theme uses the same value. - static const background = Color(0xFF05070A); - static const accent = Color(0xFFFF8A3D); + static const background = Palette.ink0; + static const accent = Palette.solarBase; @override State createState() => _SplashScreenState(); diff --git a/build/art-preview/brand.png b/build/art-preview/brand.png new file mode 100644 index 0000000..9614deb Binary files /dev/null and b/build/art-preview/brand.png differ diff --git a/docs/art-direction.md b/docs/art-direction.md new file mode 100644 index 0000000..c2bf376 --- /dev/null +++ b/docs/art-direction.md @@ -0,0 +1,91 @@ +# Art Direction + +Wie die Grafiken von IRON ARC entstehen: **SVG-Master → Raster**, alles aus einer +Palette-Datei generiert. Kein Pixelgeschubse, keine Binärdateien ohne Quelle. + +``` +tools/art/palette.json Design-Tokens (Farben, Type) +tools/art/artlib.py Primitiven: Gradienten, Grain, Vignette, Catmull-Rom-Kurven, Ballistik, Panzer +tools/art/gen_brand.py Icon (Legacy + Adaptive + Monochrom), Splash-Lockup, Feature-Graphic +tools/art/artgen.py CLI: brand | palette | preview | all +``` + +```bash +python3 tools/art/artgen.py all # Assets + app/lib/src/ui/palette.dart neu bauen +``` + +Voraussetzungen: `rsvg-convert` (librsvg ≥ 2.5), Roboto (Black/Bold/Medium). Prüfen mit +`rsvg-convert --version` und `fc-match 'Roboto:weight=black'`. + +## Prinzipien + +Die Regeln sind der Grund, warum die Bilder nicht nach Platzhalter aussehen: + +1. **Licht kommt vom Horizont.** Eine Sonne tief über dem Grat liefert Glow, Rim-Lights und + Farbverläufe. Nie von oben links, nie zwei Lichtquellen. +2. **Jede Silhouette bekommt eine warme Kante.** Ein 2-px-Rim in `solar.light` trennt Berg und + Panzer vom Himmel – ohne ihn wirken Flächen wie Aufkleber. +3. **Eine Akzentfarbe.** Amber (`solar.*`) ist der Spieler, Stahlblau (`steel.*`) der Gegner. + Alles andere bleibt Ink/Text. +4. **Grain + Vignette über das ganze Bild.** 5 % Rauschen und eine weiche Vignette (0,36–0,42) + nehmen dem Vektor-Look die Kälte. Immer als letzte Ebene, nie pro Form. +5. **Bewegung statt Symmetrie.** Der Schuss ist asymmetrisch und verlässt das Bild nach oben + rechts. Ein vollständiger Parabelbogen liest sich als Kuppel oder Regenbogen. +6. **Typografie:** Roboto Black, Tracking −0,02 em für Wortmarken; Unterzeilen in + Versalien mit weitem Tracking (4–8). Genau **ein** farbiges Wort (`ARC`). + +## Palette + +| Gruppe | Tokens | Verwendung | +|---|---|---| +| `ink.0…3` | `#05070A` … `#1B2C44` | Canvas, Panels, Rahmen | +| `solar.*` | `#FFD9A0`, `#FFB347`, `#FF7A2F` | Spieler, Sonne, Akzent, CTA | +| `steel.*` | `#9FE3F0`, `#4EA8C8`, `#2C6F8A` | Gegner, Sekundärinformation | +| `terrain.*` | `#E8C08A`, `#7A6A45`, `#3A2F20`, `#241C12` | Boden, Rim-Light, Straten | +| `text.*` | `#F5F7FA`, `#A9B4C4`, `#6C7A8D` | Hierarchie | + +`tools/art/artgen.py palette` schreibt daraus `app/lib/src/ui/palette.dart` – App und Assets +können damit nicht auseinanderlaufen. + +## Assets und ihre Quellen + +| Datei | Quelle | Größe | +|---|---|---| +| `store/assets/icon_512.png` | `icon_svg()` | 512 × 512, randlos | +| `store/assets/feature_1024x500.png` | `feature_svg()` | 1024 × 500 | +| `store/assets/logo_mark.png`, `app/assets/logo_mark.png` | `lockup_svg()` | 640 × 780, transparent | +| `res/drawable-xxxhdpi/launch_logo.png` | `lockup_svg()` | 512 breit (Pre-12-Launch) | +| `res/drawable-xxxhdpi/launch_logo_splash.png` | `splash_icon_svg()` | 512, Motiv in 60 % (API 31+) | +| `res/mipmap-*/ic_launcher.png` | `icon_svg()` | 48/72/96/144/192 | +| `res/mipmap-*/ic_launcher_{background,foreground,monochrome}.png` | `background_svg()`, `foreground_svg()`, `monochrome_svg()` | 108 dp × Dichte | +| `res/mipmap-anydpi-v26/ic_launcher{,_round}.xml` | `ADAPTIVE_XML` | Adaptive-Icon-Verknüpfung | + +## Regeln für Adaptive Icons (Android 8+) + +- Der Foreground wird in einem 108-dp-Canvas geliefert; sichtbar sind nur die inneren 72 dp. + `foreground_svg()` skaliert das Motiv deshalb auf 58 % und hebt es leicht an, damit der + Boden nicht in die Maske läuft. +- **Monochrom** (Android 13 Themed Icons) ist ein eigenes Motiv: Sonne, Teilschuss, Horizontlinie. + Keine Details, die bei 108 dp zu Matsch werden. +- Das Android-12-Splash-Icon wird vom System auf die inneren 192 von 288 dp maskiert; deshalb + ist `splash_icon_svg()` ein Kreis-Badge bei 60 % der Fläche. + +## Was bei 48 dp noch lesbar sein muss + +Der Test für jedes Icon: auf 48 × 48 px verkleinern und ansehen. Bestehen nur drei Dinge – +**Sonne**, **Diagonale**, **Bodenkante** – ist das Icon gut. Alles andere (Panzerdetails, +Sternen, Trail-Punkte) ist Zugabe für große Darstellungen. + +## Offene Lücken (Phase 2) + +Die Marken-Assets sind generiert; die **Ingame-Grafik** ist noch handgezeichneter Canvas-Code +(`app/lib/src/game/iron_arc_game.dart`): flacher Boden, Pastell-Rechtecke als Panzer. +Geplant ist ein `gen_ingame.py`, das aus derselben Palette liefert: + +1. Himmel-Gradient + parallaxe Bergrücken als PNG-Ebenen (Flame `ParallaxComponent`). +2. Boden-Straten als kachelbare Textur plus Rim-Light entlang der Heightmap. +3. Panzer als Sprites (Hull/Turret/Lauf) statt Rechtecke, je Seite eine Palette. +4. Explosion/Mündungsfeuer als Sprite-Sheet statt gezeichneter Kreise. + +Die Golden-Tests (`app/test/goldens/`) müssen danach mit `flutter test --update-goldens` +neu erzeugt und im Review angesehen werden. diff --git a/docs/status/autonomous-log.md b/docs/status/autonomous-log.md index f244a64..06d1ec3 100644 --- a/docs/status/autonomous-log.md +++ b/docs/status/autonomous-log.md @@ -166,6 +166,40 @@ startete erst beim ersten Zugriff (Bootlog 0 ms). Jetzt Start in `main()`. - MIUI verweigert `adb install` von release-signierten APKs (`INSTALL_FAILED_USER_RESTRICTED`) → fuer Messungen `--profile` (AOT, debug-signiert). +## M7d — Grafik-Pipeline (erledigt 2026-10-25) + +**Ausgangslage:** Icon, Feature-Graphic und Splash bestanden aus flachen Formen – Mintgrün +gegen Navy, keine Tiefe, keine Lichtführung, Wortmarke in Standardschrift. + +**Lösung:** Assets werden generiert statt gemalt. `tools/art/` erzeugt SVG-Master und +rastert sie mit librsvg; Farben kommen aus `palette.json`, das auch `app/lib/src/ui/palette.dart` +speist. Damit können App-Theme und Grafik nicht auseinanderlaufen. + +| Baustein | Inhalt | +|---|---| +| `artlib.py` | Gradienten, Blur/Grain/Vignette-Filter, Catmull-Rom-Kurven, reproduzierbare Hügelketten, Ballistik, Text mit Tracking | +| `gen_brand.py` | Icon (Legacy-Mipmaps + Adaptive Background/Foreground + Monochrom), Splash-Badge und -Lockup, Feature-Graphic | +| `artgen.py` | CLI `brand \| palette \| preview \| all`, schreibt 24 Dateien | + +**Gestaltungsregeln** (dokumentiert in [../art-direction.md](../art-direction.md)): Licht vom +Horizont, warme Rim-Lights auf jeder Silhouette, genau eine Akzentfarbe, Grain+Vignette über +das ganze Bild, Asymmetrie statt Kuppel, Roboto Black mit negativem Tracking. + +**Erkenntnisse** +- Ein vollständiger Ballistikbogen liest sich als Kuppel oder Regenbogen. Erst der Bogen, der + das Bild nach oben rechts verlässt, wirkt wie ein Schuss. +- Androids Splash-Icon maskiert alles außerhalb der inneren 192 von 288 dp → Motiv muss in + ~60 % der Fläche liegen; eine kreisförmige Plakette mit gezoomtem Ausschnitt schlägt + jede rechteckige Kachel. +- Das zusätzliche `dy`-Verschieben war nötig, weil der Adaptive-Foreground sonst in die + 108-dp-Maske läuft (Motiv auf 58 %, leicht angehoben). +- Wortmarken in SVG verlieren das Leerzeichen zwischen Tspanen → explizites `dx`. +- rsvg/Pango braucht installierte Fonts; Roboto aus dem Flutter-Cache nach + `~/.local/share/fonts` kopieren, sonst rendert Pango in DejaVu. + +**Offen (Phase 2):** die Ingame-Grafik ist weiterhin Canvas-Code (flacher Boden, +Rechteck-Panzer). `docs/art-direction.md` beschreibt das geplante `gen_ingame.py`. + ## Nächste Schritte (aktualisiert) 1. `bundletool build-apks --connected-device` aus `~/exports/iron-arc-0.7.0.aab` → Install → Smoke. diff --git a/store/assets/feature_1024x500.png b/store/assets/feature_1024x500.png index 9e1350b..224f16f 100644 Binary files a/store/assets/feature_1024x500.png and b/store/assets/feature_1024x500.png differ diff --git a/store/assets/icon_512.png b/store/assets/icon_512.png index 887e652..7361e79 100644 Binary files a/store/assets/icon_512.png and b/store/assets/icon_512.png differ diff --git a/store/assets/logo_mark.png b/store/assets/logo_mark.png index 540034c..b8c4870 100644 Binary files a/store/assets/logo_mark.png and b/store/assets/logo_mark.png differ diff --git a/tools/art/README.md b/tools/art/README.md new file mode 100644 index 0000000..514348b --- /dev/null +++ b/tools/art/README.md @@ -0,0 +1,10 @@ +# Art-Pipeline + +Erzeugt Icon, Splash-Lockup und Feature-Graphic als SVG-Master und rastert sie. + +```bash +python3 tools/art/artgen.py all # Assets + app/lib/src/ui/palette.dart +python3 tools/art/artgen.py preview # Kontaktbogen in build/art-preview/brand.png +``` + +Braucht `rsvg-convert` und Roboto. Details, Regeln und die Palette: [../../docs/art-direction.md](../../docs/art-direction.md). diff --git a/tools/art/__pycache__/artlib.cpython-314.pyc b/tools/art/__pycache__/artlib.cpython-314.pyc new file mode 100644 index 0000000..10513ea Binary files /dev/null and b/tools/art/__pycache__/artlib.cpython-314.pyc differ diff --git a/tools/art/__pycache__/gen_brand.cpython-314.pyc b/tools/art/__pycache__/gen_brand.cpython-314.pyc new file mode 100644 index 0000000..4b44757 Binary files /dev/null and b/tools/art/__pycache__/gen_brand.cpython-314.pyc differ diff --git a/tools/art/artgen.py b/tools/art/artgen.py new file mode 100755 index 0000000..7485557 --- /dev/null +++ b/tools/art/artgen.py @@ -0,0 +1,80 @@ +#!/usr/bin/env python3 +"""IRON ARC art pipeline. + + python3 tools/art/artgen.py all # brand assets + Flutter tokens + python3 tools/art/artgen.py brand # icons, splash, feature graphic + python3 tools/art/artgen.py palette # app/lib/src/ui/palette.dart + python3 tools/art/artgen.py preview # contact sheet in build/art-preview + +Everything is SVG-authored and rasterised with librsvg, so the sources stay +editable and every size is crisp. Colours come from palette.json - change a +token there, re-run, and icons, splash, feature graphic and app theme follow. +""" + +from __future__ import annotations + +import json +import sys +from pathlib import Path + +sys.path.insert(0, str(Path(__file__).resolve().parent)) + +import artlib as A +import gen_brand as brand + +DART_OUT = A.ROOT / "app" / "lib" / "src" / "ui" / "palette.dart" + +DART_HEADER = """// GENERATED FILE - do not edit by hand. +// Source: tools/art/palette.json, generator: tools/art/artgen.py +// Re-run `python3 tools/art/artgen.py palette` after changing a token. + +import 'package:flutter/material.dart'; + +/// Design tokens shared by the app and the generated art. +abstract final class Palette { +""" + + +def _dart_color(value: str) -> str: + h = value.lstrip("#").upper() + if len(h) == 6: + h = "FF" + h + return f"Color(0x{h})" + + +def write_palette() -> Path: + data = json.loads((A.ART_DIR / "palette.json").read_text(encoding="utf-8")) + lines = [DART_HEADER] + for group, values in data.items(): + if group.startswith("$") or not isinstance(values, dict): + continue + lines.append(f" // {group}") + for key, value in values.items(): + if isinstance(value, str) and value.startswith("#"): + name = f"{group}{key[0].upper()}{key[1:]}" + lines.append(f" static const {name} = {_dart_color(value)};") + lines.append("") + lines.append("}") + text = "\n".join(lines) + "\n" + DART_OUT.parent.mkdir(parents=True, exist_ok=True) + DART_OUT.write_text(text, encoding="utf-8") + return DART_OUT + + +def main(argv: list[str]) -> int: + cmd = argv[1] if len(argv) > 1 else "all" + if cmd in ("brand", "all"): + for path in brand.write_all(): + print(f" {path.relative_to(A.ROOT)} {path.stat().st_size} B") + if cmd in ("palette", "all"): + print(f" {write_palette().relative_to(A.ROOT)}") + if cmd in ("preview", "all"): + print("preview:", brand.preview().relative_to(A.ROOT)) + if cmd not in ("brand", "palette", "preview", "all"): + print(__doc__) + return 2 + return 0 + + +if __name__ == "__main__": + raise SystemExit(main(sys.argv)) diff --git a/tools/art/artlib.py b/tools/art/artlib.py new file mode 100644 index 0000000..628136d --- /dev/null +++ b/tools/art/artlib.py @@ -0,0 +1,271 @@ +"""Drawing primitives for IRON ARC art. + +Everything is authored as SVG (real gradients, blur, grain) and rasterised with +`rsvg-convert`, so the same source yields a crisp 48 dp launcher icon and a +1024 px store graphic. No pixel pushing, no hand-tuned anti-aliasing. + +Style rules that make the output look deliberate (see docs/art-direction.md): + * light comes from the horizon, never from the top corners; + * every silhouette gets a warm rim on its upper edge; + * grain + vignette are applied to the *whole* composition, not per shape; + * type is Roboto Black with negative tracking, one accent word only. +""" + +from __future__ import annotations + +import json +import math +import random +import subprocess +import tempfile +from pathlib import Path +from typing import Iterable, Sequence + +ROOT = Path(__file__).resolve().parents[2] +ART_DIR = Path(__file__).resolve().parent + + +# --------------------------------------------------------------------------- # +# palette +# --------------------------------------------------------------------------- # +class Palette: + def __init__(self, data: dict): + self._d = data + + @classmethod + def load(cls, path: Path | None = None) -> "Palette": + path = path or (ART_DIR / "palette.json") + return cls(json.loads(path.read_text(encoding="utf-8"))) + + def color(self, path: str) -> str: + """`P.color('solar.base')` -> '#FFB347'.""" + node: object = self._d + for part in path.split("."): + node = node[part] # type: ignore[index] + return str(node) + + def value(self, path: str): + node: object = self._d + for part in path.split("."): + node = node[part] # type: ignore[index] + return node + + +def rgba(hex_color: str, alpha: float) -> str: + """`#FFB347` + 0.4 -> `rgba(255,179,71,0.4)` for SVG fills/strokes.""" + h = hex_color.lstrip("#") + r, g, b = (int(h[i : i + 2], 16) for i in (0, 2, 4)) + return f"rgba({r},{g},{b},{alpha:.3f})" + + +# --------------------------------------------------------------------------- # +# document +# --------------------------------------------------------------------------- # +def svg_doc(width: float, height: float, body: str, defs: str = "") -> str: + return ( + f'' + f"{defs}{body}" + ) + + +def linear_gradient( + gid: str, + stops: Sequence[tuple[float, str, float]], + x1: float = 0, + y1: float = 0, + x2: float = 0, + y2: float = 1, +) -> str: + parts = "".join( + f'' + for o, c, a in stops + ) + return ( + f'' + f"{parts}" + ) + + +def radial_gradient( + gid: str, + stops: Sequence[tuple[float, str, float]], + cx: float = 0.5, + cy: float = 0.5, + r: float = 0.5, +) -> str: + parts = "".join( + f'' + for o, c, a in stops + ) + return ( + f'' + f"{parts}" + ) + + +def blur_filter(fid: str, std: float) -> str: + return ( + f'' + f'' + ) + + +def grain_filter(fid: str = "grain", freq: float = 0.9, octaves: int = 3) -> str: + """Monochrome fractal noise; overlay it at 3-8 % for a filmic finish.""" + return ( + f'' + f'' + f'' + ) + + +def vignette_def(gid: str = "vignette", strength: float = 0.55) -> str: + return radial_gradient( + gid, + [(0.45, "#000000", 0.0), (1.0, "#000000", strength)], + r=0.78, + ) + + +# --------------------------------------------------------------------------- # +# geometry +# --------------------------------------------------------------------------- # +def smooth_path(points: Sequence[tuple[float, float]], closed: bool = False) -> str: + """Catmull-Rom through the points, emitted as cubic beziers.""" + if len(points) < 2: + raise ValueError("need at least two points") + pts = list(points) + if closed: + pts = [pts[-1]] + pts + [pts[0], pts[1]] + else: + pts = [pts[0]] + pts + [pts[-1]] + + d = f"M {pts[1][0]:.2f} {pts[1][1]:.2f}" + for i in range(1, len(pts) - 2): + p0, p1, p2, p3 = pts[i - 1], pts[i], pts[i + 1], pts[i + 2] + c1 = (p1[0] + (p2[0] - p0[0]) / 6.0, p1[1] + (p2[1] - p0[1]) / 6.0) + c2 = (p2[0] - (p3[0] - p1[0]) / 6.0, p2[1] - (p3[1] - p1[1]) / 6.0) + d += ( + f" C {c1[0]:.2f} {c1[1]:.2f} {c2[0]:.2f} {c2[1]:.2f} " + f"{p2[0]:.2f} {p2[1]:.2f}" + ) + if closed: + d += " Z" + return d + + +def hill_ridge( + width: float, + base_y: float, + amplitude: float, + seed: int, + *, + steps: int = 7, + phase: float = 0.0, + foot: float | None = None, +) -> list[tuple[float, float]]: + """Reproducible skyline: two sines + seeded jitter, optionally closed to the foot.""" + rnd = random.Random(seed) + pts: list[tuple[float, float]] = [] + for i in range(steps + 1): + t = i / steps + x = t * width + wave = math.sin((t * 2.2 + phase) * math.tau) * 0.55 + wave += math.sin((t * 5.1 + phase * 1.7) * math.tau) * 0.22 + jitter = (rnd.random() - 0.5) * 0.30 if 0 < i < steps else 0.0 + y = base_y - amplitude * (0.5 + 0.5 * wave + jitter) + pts.append((x, y)) + if foot is not None: + pts.append((width, foot)) + pts.append((0, foot)) + return pts + + +def ballistic_arc( + x0: float, y0: float, x1: float, y1: float, apex_y: float, steps: int = 26 +) -> list[tuple[float, float]]: + """Parabola through the apex height - the game's signature shape.""" + pts = [] + for i in range(steps + 1): + t = i / steps + x = x0 + (x1 - x0) * t + base = y0 + (y1 - y0) * t + bump = 4 * t * (1 - t) # vanishes at both ends + y = base + (apex_y - (y0 + y1) / 2) * bump + pts.append((x, y)) + return pts + + +# --------------------------------------------------------------------------- # +# type +# --------------------------------------------------------------------------- # +def text( + x: float, + y: float, + content: str, + *, + size: float, + fill: str, + weight: int = 400, + family: str = "Roboto", + anchor: str = "start", + tracking: float = 0.0, + opacity: float = 1.0, + extra: str = "", +) -> str: + return ( + f'{content}' + ) + + +# --------------------------------------------------------------------------- # +# raster +# --------------------------------------------------------------------------- # +def render(svg: str, out: Path, width: int | None = None) -> Path: + """Rasterise SVG with librsvg (crisp text, real filters).""" + out.parent.mkdir(parents=True, exist_ok=True) + cmd = ["rsvg-convert", "-o", str(out)] + if width: + cmd += ["-w", str(width)] + with tempfile.NamedTemporaryFile("w", suffix=".svg", delete=False) as fh: + fh.write(svg) + tmp = fh.name + try: + subprocess.run(cmd + [tmp], check=True, capture_output=True) + finally: + Path(tmp).unlink(missing_ok=True) + return out + + +def contact_sheet( + paths: Iterable[Path], out: Path, cols: int = 3, cell: int = 320 +) -> Path: + """Preview grid so generated art can be reviewed at a glance.""" + from PIL import Image, ImageDraw + + files = [p for p in paths if p.exists()] + if not files: + raise SystemExit("nothing to preview") + rows = (len(files) + cols - 1) // cols + sheet = Image.new("RGB", (cols * cell, rows * (cell + 22)), (18, 20, 24)) + draw = ImageDraw.Draw(sheet) + for i, path in enumerate(files): + img = Image.open(path).convert("RGBA") + size = img.size + img.thumbnail((cell - 16, cell - 16), Image.LANCZOS) + x = (i % cols) * cell + 8 + y = (i // cols) * (cell + 22) + 8 + # checkerboard so transparency is obvious + for cy in range(y, y + cell - 16, 16): + for cx in range(x, x + cell - 16, 16): + shade = 40 if ((cx // 16 + cy // 16) % 2) else 30 + draw.rectangle([cx, cy, cx + 15, cy + 15], fill=(shade, shade, shade)) + sheet.paste(img, (x, y), img) + draw.text((x, y + cell - 14), f"{path.name} {size}", fill=(180, 190, 205)) + out.parent.mkdir(parents=True, exist_ok=True) + sheet.save(out) + return out diff --git a/tools/art/gen_brand.py b/tools/art/gen_brand.py new file mode 100644 index 0000000..2e54e8b --- /dev/null +++ b/tools/art/gen_brand.py @@ -0,0 +1,558 @@ +"""Generates the IRON ARC brand art: launcher icon (legacy + adaptive + +monochrome), splash lockup and the Play feature graphic. + + python3 tools/art/artgen.py brand + +All output is derived from ../palette.json, so a colour change propagates +everywhere. Art is authored as SVG and rasterised, never painted pixel by pixel. +""" + +from __future__ import annotations + +import sys +from pathlib import Path + +sys.path.insert(0, str(Path(__file__).resolve().parent)) + +import artlib as A + +P = A.Palette.load() +INK0 = P.color("ink.0") +INK1 = P.color("ink.1") +INK2 = P.color("ink.2") +INK3 = P.color("ink.3") +SOLAR_L = P.color("solar.light") +SOLAR = P.color("solar.base") +SOLAR_D = P.color("solar.deep") +STEEL_L = P.color("steel.light") +STEEL = P.color("steel.base") +RIM = P.color("terrain.rim") +SOIL = P.color("terrain.soil") +DEEP = P.color("terrain.deep") +TEXT_HI = P.color("text.hi") +TEXT_MID = P.color("text.mid") +WEIGHT = int(P.value("type.displayWeight")) +TRACK = float(P.value("type.trackingEm")) + +ANDROID = A.ROOT / "app" / "android" / "app" / "src" / "main" / "res" +APP_ASSETS = A.ROOT / "app" / "assets" +STORE = A.ROOT / "store" / "assets" +PREVIEW = A.ROOT / "build" / "art-preview" + + +# --------------------------------------------------------------------------- # +# shared scene pieces +# --------------------------------------------------------------------------- # +def sky_defs(tag: str, w: float, h: float, horizon: float) -> str: + """Dusk gradient plus a warm glow sitting on the horizon.""" + return ( + A.linear_gradient( + f"sky{tag}", + [ + (0.00, INK0, 1), + (0.45, INK1, 1), + (0.78, "#132135", 1), + (1.00, "#1B2C44", 1), + ], + ) + + A.radial_gradient( + f"glow{tag}", + [(0.00, SOLAR_D, 0.55), (0.45, SOLAR_D, 0.20), (1.00, SOLAR_D, 0.0)], + cx=0.5, + cy=horizon / h, + r=0.62, + ) + + A.blur_filter(f"soft{tag}", 6) + ) + + +def sky(w: float, h: float, horizon: float, tag: str = "") -> str: + return ( + f'' + f'' + ) + + +def sun(cx: float, cy: float, r: float, tag: str = "") -> str: + """Sun disc with a soft corona - the light source of every composition.""" + return ( + f'' + f'' + ) + + +def sun_defs(tag: str) -> str: + return A.radial_gradient( + f"sun{tag}", + [ + (0.00, "#FFF3DC", 1), + (0.42, SOLAR_L, 1), + (0.78, SOLAR, 1), + (1.00, SOLAR_D, 1), + ], + cx=0.42, + cy=0.38, + r=0.62, + ) + + +def ridge( + points: list[tuple[float, float]], + fill: str, + rim: str, + rim_width: float, + tag: str = "", +) -> str: + fill = fill.replace("{tag}", tag) + """Silhouette plus the warm rim light that separates it from the sky.""" + d = A.smooth_path(points, closed=True) + open_d = A.smooth_path(points[:-2]) if len(points) > 2 else d + return ( + f'' + f'' + ) + + +def shot_trail(pts: list[tuple[float, float]], width: float, *, dots: int = 10) -> str: + """Directional trail: fading dots behind, one crisp stroke in front. + + A full parabola reads as a dome (and as a rainbow); letting the shot leave + the frame keeps the icon dynamic.""" + cut = int(len(pts) * 0.30) + trail = "" + for i in range(dots): + t = i / max(dots - 1, 1) + x, y = pts[int(t * cut)] + r = width * (0.18 + 0.26 * t) + trail += ( + f'' + ) + head = A.smooth_path(pts[cut:]) + head_full = A.smooth_path(pts) + return ( + trail + + f'' + + f'' + ) + + +def arc_defs() -> str: + return A.linear_gradient( + "arc", [(0.0, SOLAR_L, 1), (0.55, SOLAR, 1), (1.0, SOLAR_D, 1)] + ) + A.blur_filter("softx", 5) + + +def finish(w: float, h: float, grain: float = 0.06, vig: float = 0.5) -> str: + """Grain + vignette over the whole frame - the cheap trick that sells depth.""" + return ( + f'' + f'' + ) + + +# --------------------------------------------------------------------------- # +# the glyph: sun, two ridges, one ballistic arc +# --------------------------------------------------------------------------- # +def tank( + cx: float, + base_y: float, + size: float, + *, + fill: str, + rim: str, + angle: float = -32.0, + flip: bool = False, +) -> str: + """A silhouette tank: hull, turret, barrel. Only reads below ~64 px as a + bump with a stick, which is exactly what a launcher icon needs.""" + w = size * (1 if not flip else -1) + hull_h = size * 0.30 + turret_w = size * 0.44 + turret_h = size * 0.20 + barrel_w = size * 0.11 + barrel_l = size * 0.62 + body = ( + # hull: slightly tapered block + f'' + # turret + f'' + # barrel, pivoting at the turret centre + f'' + f'' + f'' + # rim light on the hull top edge + f'' + ) + return ( + f'' + body + ) + + +def muzzle_glow(x: float, y: float, r: float) -> str: + """Warm bloom right at the barrel mouth - the shot just left.""" + return ( + f'' + ) + + +def stars(S: float, count: int = 7, seed: int = 3, size: float | None = None, x0: float = 0.05) -> str: + """A few dim points of light: fills the empty sky without becoming noise.""" + import random + + rnd = random.Random(seed) + unit = size if size is not None else S + out = "" + for _ in range(count): + x = rnd.uniform(x0, 0.95) * S + y = rnd.uniform(0.04, 0.42) * S + r = rnd.uniform(0.0025, 0.0055) * unit + a = rnd.uniform(0.20, 0.55) + out += f'' + return out + + +def glyph( + S: float, + tag: str, + *, + with_sky: bool = True, + k: float = 1.0, + dy: float = 0.0, + rim_alpha: float = 1.0, +) -> str: + """Drawable in a 0..S box; `k` shrinks it for the adaptive safe zone.""" + horizon = 0.715 * S + body = "" + if with_sky: + body += sky(S, S, horizon, tag) + # The shot leaves the frame at the top right: no dome, no rainbow. + # muzzle sits at the barrel tip (see tank(): pivot + L at 38 deg) + shot = A.ballistic_arc( + 0.340 * S, 0.623 * S, 1.080 * S, -0.180 * S, apex_y=0.155 * S, steps=48 + ) + inner = ( + stars(S) + + sun(0.690 * S, 0.640 * S, 0.135 * S, tag) + + ridge( + A.hill_ridge(S, 0.775 * S, 0.046 * S, seed=7, steps=6, foot=S), + "#0F1B2E", + A.rgba(RIM, 0.20), + 0.007 * S, + tag, + ) + + shot_trail(shot, 0.024 * S) + + muzzle_glow(0.340 * S, 0.623 * S, 0.024 * S) + + ridge( + A.hill_ridge(S, 0.862 * S, 0.030 * S, seed=11, steps=4, phase=0.42, foot=S), + "url(#ground{tag})", + A.rgba(SOLAR_L, 0.38 * rim_alpha), + 0.009 * S, + tag, + ) + + tank( + 0.225 * S, + 0.884 * S, + 0.30 * S, + fill="#0B1420", + rim=A.rgba(SOLAR_L, 0.60), + angle=38, + ) + ) + if k >= 1.0: + return body + inner + t = S * (1 - k) / 2 + return body + f'{inner}' + + +def glyph_defs(tag: str) -> str: + return ( + A.linear_gradient( + f"ground{tag}", + [(0.0, "#241D13", 1), (0.40, "#120F0A", 1), (1.0, "#07080A", 1)], + ) + + sky_defs(tag, 1, 1, 0.705) + + sun_defs(tag) + + arc_defs() + + A.grain_filter() + + A.vignette_def() + ) + + +def icon_svg(S: int = 1024) -> str: + return A.svg_doc( + S, + S, + glyph(S, "") + finish(S, S, grain=0.05, vig=0.42), + glyph_defs(""), + ) + + +def foreground_svg(S: int = 432) -> str: + """Adaptive icon foreground: transparent, content inside the 72/108 safe zone.""" + return A.svg_doc(S, S, glyph(S, "f", with_sky=False, k=0.58, dy=-0.02), glyph_defs("f")) + + +def background_svg(S: int = 432) -> str: + return A.svg_doc( + S, + S, + sky(S, S, 0.705 * S, "b") + finish(S, S, grain=0.05, vig=0.45), + sky_defs("b", S, S, 0.705 * S) + A.grain_filter() + A.vignette_def(), + ) + + +def monochrome_svg(S: int = 432) -> str: + """Android 13 themed icons: one ink, tinted by the launcher.""" + shot = A.ballistic_arc( + 0.340 * S, 0.623 * S, 1.080 * S, -0.180 * S, apex_y=0.155 * S, steps=40 + ) + body = ( + f'' + f'' + f'' + ) + t = S * 0.13 + return A.svg_doc(S, S, f'{body}') + + +def splash_icon_svg(S: int = 512) -> str: + """Android 12+ splash icon: badge only, inside the mask-safe 60 % of the canvas.""" + r = S * 0.32 + cx = cy = S / 2 + body = clip_def("s", cx, cy, r) + badge(cx, cy, r, "s", zoom=1.28, focus=(0.56, 0.615)) + return A.svg_doc(S, S, body, glyph_defs("s")) + + +# --------------------------------------------------------------------------- # +# circular badge + wordmark lockup +# --------------------------------------------------------------------------- # +def clip_def(tag: str, cx: float, cy: float, r: float) -> str: + return ( + f'' + f'' + ) + + +def badge( + cx: float, + cy: float, + r: float, + tag: str, + *, + zoom: float = 1.30, + focus: tuple[float, float] = (0.55, 0.60), +) -> str: + """The glyph art zoomed onto its subject and clipped to a circle. + + A circular badge cannot show the square scene - the corners are masked away - + so the art is scaled up and centred on sun, arc and tank.""" + inner = 2048 + s = (2 * r * zoom) / inner + tx = cx - focus[0] * inner * s + ty = cy - focus[1] * inner * s + return ( + f'' + f'' + f"{glyph(inner, tag, rim_alpha=0.18)}" + f'' + ) + + +def lockup_svg(w: int = 640, h: int = 780, *, badge_only: bool = False) -> str: + """Circular badge above the wordmark - used for splash and store listing.""" + r = 138.0 + cx, cy = w / 2, 176.0 + body = ( + clip_def("k", cx, cy, r) + + badge(cx, cy, r, "k") + + f'' + ) + if badge_only: + return A.svg_doc(w, h, body, glyph_defs("k") + A.blur_filter("softk", 12)) + + title_y = cy + r + 126 + body += ( + f'' + f'IRON' + f'ARC' + f'TAKTISCHES PANZERDUELL' + ) + return A.svg_doc(w, h, body, glyph_defs("k") + A.blur_filter("softk", 12)) + + +# --------------------------------------------------------------------------- # +# Play feature graphic 1024x500 +# --------------------------------------------------------------------------- # +def feature_svg(w: int = 1024, h: int = 500) -> str: + """Title block left, self-contained dusk scene in the right half. + + The shot stays inside its half of the canvas - a line crossing the wordmark + is exactly the kind of detail that makes store art look amateurish. + """ + horizon = 0.66 * h + shot = A.ballistic_arc( + 0.585 * w, 0.615 * h, 1.045 * w, -0.070 * h, apex_y=0.165 * h, steps=56 + ) + body = ( + sky(w, h, horizon, "f") + + stars(w, 6, seed=5, size=min(w, h), x0=0.62) + + sun(0.755 * w, 0.440 * h, 0.105 * w, "f") + + ridge( + A.hill_ridge(w, 0.660 * h, 0.038 * h, seed=7, steps=7, foot=h), + "#0F1B2E", + A.rgba(RIM, 0.22), + 2.0, + "f", + ) + + shot_trail(shot, 3.2) + + ridge( + A.hill_ridge(w, 0.870 * h, 0.048 * h, seed=11, steps=5, phase=0.42, foot=h), + "url(#groundf)", + A.rgba(SOLAR_L, 0.34), + 2.4, + "f", + ) + + f'' + + text_block(w) + + finish(w, h, grain=0.05, vig=0.36) + ) + defs = ( + glyph_defs("f") + + A.linear_gradient( + "groundf", + [(0.0, "#2A2318", 1), (0.40, "#14110C", 1), (1.0, "#07080A", 1)], + ) + + A.linear_gradient( + "scrim", + [(0.0, INK0, 0.97), (0.62, INK0, 0.88), (1.0, INK0, 0.0)], + x1=0, + y1=0, + x2=1, + y2=0, + ) + ) + return A.svg_doc(w, h, body, defs) + + +def text_block(w: float) -> str: + """Type lockup: one accent word, wide-tracked caps for the rest.""" + return ( + f'' + f'IRON' + f'ARC' + f'' + f'TAKTISCHES PANZERDUELL' + f'' + f'' + f'1 GEGEN 1 · OFFLINE UND ONLINE' + ) + + +ADAPTIVE_XML = """ + + + + + + +""" + +DENSITIES = { + "mdpi": 1.0, + "hdpi": 1.5, + "xhdpi": 2.0, + "xxhdpi": 3.0, + "xxxhdpi": 4.0, +} + + +def write_all() -> list[Path]: + """Render every brand asset into the app and the store folder.""" + written: list[Path] = [] + + written.append(A.render(icon_svg(1024), STORE / "icon_512.png", width=512)) + written.append(A.render(feature_svg(), STORE / "feature_1024x500.png")) + + lockup = A.render(lockup_svg(), STORE / "logo_mark.png", width=640) + written.append(lockup) + written.append(A.render(lockup_svg(), APP_ASSETS / "logo_mark.png", width=640)) + + written.append(A.render(lockup_svg(), ANDROID / "drawable-xxxhdpi" / "launch_logo.png", width=512)) + written.append( + A.render(splash_icon_svg(512), ANDROID / "drawable-xxxhdpi" / "launch_logo_splash.png") + ) + + for density, factor in DENSITIES.items(): + folder = ANDROID / f"mipmap-{density}" + legacy = int(48 * factor) + adaptive = int(108 * factor) + written.append(A.render(icon_svg(1024), folder / "ic_launcher.png", width=legacy)) + written.append( + A.render(foreground_svg(adaptive), folder / "ic_launcher_foreground.png") + ) + written.append( + A.render(background_svg(adaptive), folder / "ic_launcher_background.png") + ) + written.append( + A.render(monochrome_svg(adaptive), folder / "ic_launcher_monochrome.png") + ) + + anydpi = ANDROID / "mipmap-anydpi-v26" + anydpi.mkdir(parents=True, exist_ok=True) + for name in ("ic_launcher.xml", "ic_launcher_round.xml"): + path = anydpi / name + path.write_text(ADAPTIVE_XML, encoding="utf-8") + written.append(path) + return written + + +def preview() -> Path: + items = [ + STORE / "icon_512.png", + STORE / "feature_1024x500.png", + STORE / "logo_mark.png", + ANDROID / "drawable-xxxhdpi" / "launch_logo_splash.png", + ANDROID / "mipmap-xxxhdpi" / "ic_launcher.png", + ANDROID / "mipmap-mdpi" / "ic_launcher.png", + ANDROID / "mipmap-xxxhdpi" / "ic_launcher_foreground.png", + ANDROID / "mipmap-xxxhdpi" / "ic_launcher_monochrome.png", + ] + return A.contact_sheet(items, PREVIEW / "brand.png", cols=3, cell=340) + + +if __name__ == "__main__": + for f in write_all(): + print(f.relative_to(A.ROOT), f.stat().st_size, "bytes") + print("preview:", preview()) diff --git a/tools/art/palette.json b/tools/art/palette.json new file mode 100644 index 0000000..9ad40d5 --- /dev/null +++ b/tools/art/palette.json @@ -0,0 +1,39 @@ +{ + "$comment": "Single source of truth for the IRON ARC look. Used by tools/art/artgen.py and mirrored into app/lib/src/ui/palette.dart.", + "ink": { + "0": "#05070A", + "1": "#0A1220", + "2": "#101B2E", + "3": "#1B2C44" + }, + "solar": { + "light": "#FFD9A0", + "base": "#FFB347", + "deep": "#FF7A2F" + }, + "steel": { + "light": "#9FE3F0", + "base": "#4EA8C8", + "deep": "#2C6F8A" + }, + "terrain": { + "rim": "#E8C08A", + "top": "#7A6A45", + "soil": "#3A2F20", + "deep": "#241C12" + }, + "state": { + "danger": "#FF5A5F", + "ok": "#6BD08A" + }, + "text": { + "hi": "#F5F7FA", + "mid": "#A9B4C4", + "low": "#6C7A8D" + }, + "type": { + "display": "Roboto", + "displayWeight": 900, + "trackingEm": -0.02 + } +}