art: generated brand system (icon, splash, feature graphic, tokens)

- tools/art/: SVG-authored art rasterised with librsvg. artlib.py provides
gradients, blur/grain/vignette filters, Catmull-Rom paths, reproducible ridges,
ballistics and type; gen_brand.py builds every asset; artgen.py is the CLI.
- palette.json is the single source of truth: it drives the art *and* generates
app/lib/src/ui/palette.dart (splash now reads Palette.ink0/solarBase).
- new icon: dusk scene with sun, an asymmetric shot leaving the frame top-right
and a tank silhouette at the muzzle. Legacy mipmaps + adaptive layers
(background/foreground/monochrome) + anydpi-v26 XML, monochrome for Android 13
themed icons.
- splash: circular badge (zoomed, mask-safe) for the Android 12 splash, badge +
wordmark lockup for the pre-12 launch bitmap and the Flutter splash. The system
icon plate is now identical to the background, so the badge floats.
- feature graphic rebuilt as a poster: type block left, scene confined to the
right half so the shot never crosses the wordmark.
- type aligned with the store title: "TAKTISCHES PANZERDUELL".
- docs/art-direction.md documents principles, palette, asset sources and the
ingame phase 2 plan.
This commit is contained in:
2026-10-25 02:11:14 +01:00
parent 3fb9dce729
commit 5f6574d08c
42 changed files with 1150 additions and 5 deletions
+3
View File
@@ -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
Binary file not shown.

Before

Width:  |  Height:  |  Size: 16 KiB

After

Width:  |  Height:  |  Size: 56 KiB

Binary file not shown.

Before

Width:  |  Height:  |  Size: 24 KiB

After

Width:  |  Height:  |  Size: 55 KiB

@@ -0,0 +1,7 @@
<?xml version="1.0" encoding="utf-8"?>
<!-- Generated by tools/art/artgen.py - do not edit by hand. -->
<adaptive-icon xmlns:android="http://schemas.android.com/apk/res/android">
<background android:drawable="@mipmap/ic_launcher_background" />
<foreground android:drawable="@mipmap/ic_launcher_foreground" />
<monochrome android:drawable="@mipmap/ic_launcher_monochrome" />
</adaptive-icon>
@@ -0,0 +1,7 @@
<?xml version="1.0" encoding="utf-8"?>
<!-- Generated by tools/art/artgen.py - do not edit by hand. -->
<adaptive-icon xmlns:android="http://schemas.android.com/apk/res/android">
<background android:drawable="@mipmap/ic_launcher_background" />
<foreground android:drawable="@mipmap/ic_launcher_foreground" />
<monochrome android:drawable="@mipmap/ic_launcher_monochrome" />
</adaptive-icon>
Binary file not shown.

Before

Width:  |  Height:  |  Size: 544 B

After

Width:  |  Height:  |  Size: 5.2 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 18 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 9.1 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 1.8 KiB

Binary file not shown.

Before

Width:  |  Height:  |  Size: 442 B

After

Width:  |  Height:  |  Size: 2.8 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 8.8 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 5.6 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 1.2 KiB

Binary file not shown.

Before

Width:  |  Height:  |  Size: 721 B

After

Width:  |  Height:  |  Size: 8.3 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 30 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 13 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 2.6 KiB

Binary file not shown.

Before

Width:  |  Height:  |  Size: 1.0 KiB

After

Width:  |  Height:  |  Size: 16 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 61 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 21 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 4.1 KiB

Binary file not shown.

Before

Width:  |  Height:  |  Size: 1.4 KiB

After

Width:  |  Height:  |  Size: 25 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 101 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 29 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 5.8 KiB

@@ -2,7 +2,7 @@
<resources>
<!-- Same near-black the game canvas uses, so launch -> splash -> game never flashes. -->
<color name="launch_bg">#FF05070A</color>
<!-- Plate behind the Android 12+ splash icon: the icon navy, so the mark
reads as a deliberate tile instead of a floating sticker. -->
<color name="launch_plate">#FF0B1220</color>
<!-- Plate behind the Android 12+ splash icon: identical to launch_bg, so the
circular badge floats instead of sitting on a visible square. -->
<color name="launch_plate">#FF05070A</color>
</resources>
Binary file not shown.

Before

Width:  |  Height:  |  Size: 16 KiB

After

Width:  |  Height:  |  Size: 75 KiB

+43
View File
@@ -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
}
+4 -2
View File
@@ -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<SplashScreen> createState() => _SplashScreenState();
Binary file not shown.

After

Width:  |  Height:  |  Size: 242 KiB

+91
View File
@@ -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.
+34
View File
@@ -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.
Binary file not shown.

Before

Width:  |  Height:  |  Size: 47 KiB

After

Width:  |  Height:  |  Size: 200 KiB

Binary file not shown.

Before

Width:  |  Height:  |  Size: 38 KiB

After

Width:  |  Height:  |  Size: 132 KiB

Binary file not shown.

Before

Width:  |  Height:  |  Size: 16 KiB

After

Width:  |  Height:  |  Size: 75 KiB

+10
View File
@@ -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).
Binary file not shown.
Binary file not shown.
+80
View File
@@ -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))
+271
View File
@@ -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'<svg xmlns="http://www.w3.org/2000/svg" width="{width}" height="{height}" '
f'viewBox="0 0 {width} {height}">'
f"<defs>{defs}</defs>{body}</svg>"
)
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'<stop offset="{o:.3f}" stop-color="{c}" stop-opacity="{a:.3f}"/>'
for o, c, a in stops
)
return (
f'<linearGradient id="{gid}" x1="{x1}" y1="{y1}" x2="{x2}" y2="{y2}">'
f"{parts}</linearGradient>"
)
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'<stop offset="{o:.3f}" stop-color="{c}" stop-opacity="{a:.3f}"/>'
for o, c, a in stops
)
return (
f'<radialGradient id="{gid}" cx="{cx}" cy="{cy}" r="{r}">'
f"{parts}</radialGradient>"
)
def blur_filter(fid: str, std: float) -> str:
return (
f'<filter id="{fid}" x="-50%" y="-50%" width="200%" height="200%">'
f'<feGaussianBlur stdDeviation="{std}"/></filter>'
)
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'<filter id="{fid}" x="0" y="0" width="100%" height="100%">'
f'<feTurbulence type="fractalNoise" baseFrequency="{freq}" '
f'numOctaves="{octaves}" stitchTiles="stitch"/>'
f'<feColorMatrix type="saturate" values="0"/></filter>'
)
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'<text x="{x}" y="{y}" font-family="{family}" font-size="{size}" '
f'font-weight="{weight}" letter-spacing="{tracking}" fill="{fill}" '
f'text-anchor="{anchor}" opacity="{opacity}" {extra}>{content}</text>'
)
# --------------------------------------------------------------------------- #
# 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
+558
View File
@@ -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'<rect width="{w}" height="{h}" fill="url(#sky{tag})"/>'
f'<rect width="{w}" height="{h}" fill="url(#glow{tag})"/>'
)
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'<circle cx="{cx}" cy="{cy}" r="{r * 1.85}" fill="{SOLAR}" '
f'opacity="0.15" filter="url(#soft{tag})"/>'
f'<circle cx="{cx}" cy="{cy}" r="{r}" fill="url(#sun{tag})"/>'
)
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'<path d="{d}" fill="{fill}"/>'
f'<path d="{open_d}" fill="none" stroke="{rim}" stroke-width="{rim_width}" '
f'stroke-linecap="round" opacity="0.85"/>'
)
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'<circle cx="{x:.2f}" cy="{y:.2f}" r="{r:.2f}" fill="{SOLAR_L}" '
f'opacity="{0.14 + 0.20 * t:.2f}"/>'
)
head = A.smooth_path(pts[cut:])
head_full = A.smooth_path(pts)
return (
trail
+ f'<path d="{head_full}" fill="none" stroke="{SOLAR}" '
f'stroke-width="{width * 1.8:.2f}" stroke-linecap="round" '
f'opacity="0.18" filter="url(#softx)"/>'
+ f'<path d="{head}" fill="none" stroke="url(#arc)" '
f'stroke-width="{width:.2f}" stroke-linecap="round"/>'
)
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'<rect width="{w}" height="{h}" fill="url(#vig)" />'
f'<rect width="{w}" height="{h}" filter="url(#grain)" opacity="{grain}" '
f'style="mix-blend-mode:overlay"/>'
)
# --------------------------------------------------------------------------- #
# 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'<path d="M {cx - w * 0.5:.2f} {base_y:.2f} '
f'L {cx + w * 0.5:.2f} {base_y:.2f} '
f'L {cx + w * 0.44:.2f} {base_y - hull_h:.2f} '
f'L {cx - w * 0.44:.2f} {base_y - hull_h:.2f} Z" fill="{fill}"/>'
# turret
f'<rect x="{cx - turret_w / 2:.2f}" y="{base_y - hull_h - turret_h:.2f}" '
f'width="{turret_w:.2f}" height="{turret_h * 1.15:.2f}" '
f'rx="{turret_h * 0.55:.2f}" fill="{fill}"/>'
# barrel, pivoting at the turret centre
f'<g transform="rotate({angle} {cx:.2f} {base_y - hull_h - turret_h * 0.4:.2f})">'
f'<rect x="{cx - barrel_w / 2:.2f}" '
f'y="{base_y - hull_h - turret_h * 0.4 - barrel_l:.2f}" '
f'width="{barrel_w:.2f}" height="{barrel_l:.2f}" '
f'rx="{barrel_w * 0.45:.2f}" fill="{fill}"/>'
f'</g>'
# rim light on the hull top edge
f'<path d="M {cx - w * 0.44:.2f} {base_y - hull_h:.2f} '
f'L {cx + w * 0.44:.2f} {base_y - hull_h:.2f}" stroke="{rim}" '
f'stroke-width="{size * 0.035:.2f}" stroke-linecap="round" opacity="0.9"/>'
)
return (
f'<ellipse cx="{cx:.2f}" cy="{base_y + size * 0.03:.2f}" '
f'rx="{size * 0.52:.2f}" ry="{size * 0.05:.2f}" fill="#000000" '
f'opacity="0.45"/>' + body
)
def muzzle_glow(x: float, y: float, r: float) -> str:
"""Warm bloom right at the barrel mouth - the shot just left."""
return (
f'<circle cx="{x:.2f}" cy="{y:.2f}" r="{r:#.2f}" fill="{SOLAR_L}" '
f'opacity="0.35" filter="url(#softx)"/>'
)
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'<circle cx="{x:.2f}" cy="{y:.2f}" r="{r:.2f}" fill="#DCE6F5" opacity="{a:.2f}"/>'
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'<g transform="translate({t:.2f},{t:.2f}) scale({k})">{inner}</g>'
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'<circle cx="{0.690 * S:.2f}" cy="{0.640 * S:.2f}" r="{0.115 * S:.2f}" '
f'fill="#FFFFFF"/>'
f'<path d="{A.smooth_path(shot)}" fill="none" stroke="#FFFFFF" '
f'stroke-width="{0.030 * S:.2f}" stroke-linecap="round"/>'
f'<path d="M {0.060 * S:.2f} {0.868 * S:.2f} L {0.940 * S:.2f} {0.868 * S:.2f}" '
f'stroke="#FFFFFF" stroke-width="{0.030 * S:.2f}" stroke-linecap="round"/>'
)
t = S * 0.13
return A.svg_doc(S, S, f'<g transform="translate({t:.2f},{t:.2f}) scale(0.74)">{body}</g>')
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'<clipPath id="clip{tag}">'
f'<circle cx="{cx:.2f}" cy="{cy:.2f}" r="{r:.2f}"/></clipPath>'
)
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'<g clip-path="url(#clip{tag})">'
f'<g transform="translate({tx:.2f},{ty:.2f}) scale({s:.5f})">'
f"{glyph(inner, tag, rim_alpha=0.18)}</g></g>"
f'<circle cx="{cx:.2f}" cy="{cy:.2f}" r="{r:.2f}" fill="none" '
f'stroke="{A.rgba(SOLAR, 0.55)}" stroke-width="{max(1.5, r * 0.012):.2f}"/>'
)
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'<circle cx="{cx}" cy="{cy}" r="{r * 1.16:.1f}" fill="{SOLAR}" '
f'opacity="0.09" filter="url(#softk)"/>'
)
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'<text x="{cx}" y="{title_y}" font-family="Roboto" font-weight="900" '
f'font-size="104" letter-spacing="-2" text-anchor="middle">'
f'<tspan fill="{TEXT_HI}">IRON</tspan>'
f'<tspan fill="{SOLAR}" dx="22">ARC</tspan></text>'
f'<text x="{cx}" y="{title_y + 54}" font-family="Roboto" font-weight="500" '
f'font-size="25" letter-spacing="7" text-anchor="middle" '
f'fill="{TEXT_MID}">TAKTISCHES PANZERDUELL</text>'
)
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'<rect x="0" y="0" width="{w * 0.54:.0f}" height="{h}" fill="url(#scrim)"/>'
+ 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'<text x="64" y="202" font-family="Roboto" font-weight="900" '
f'font-size="100" letter-spacing="-3">'
f'<tspan fill="{TEXT_HI}">IRON</tspan>'
f'<tspan fill="{SOLAR}" dx="22">ARC</tspan></text>'
f'<text x="66" y="250" font-family="Roboto" font-weight="500" '
f'font-size="21" letter-spacing="4" fill="{TEXT_MID}">'
f'TAKTISCHES PANZERDUELL</text>'
f'<rect x="66" y="274" width="112" height="3" rx="1.5" '
f'fill="{SOLAR}" opacity="0.85"/>'
f'<text x="66" y="314" font-family="Roboto" font-weight="400" '
f'font-size="20" letter-spacing="2" fill="{TEXT_MID}">'
f'1 GEGEN 1 · OFFLINE UND ONLINE</text>'
)
ADAPTIVE_XML = """<?xml version="1.0" encoding="utf-8"?>
<!-- Generated by tools/art/artgen.py - do not edit by hand. -->
<adaptive-icon xmlns:android="http://schemas.android.com/apk/res/android">
<background android:drawable="@mipmap/ic_launcher_background" />
<foreground android:drawable="@mipmap/ic_launcher_foreground" />
<monochrome android:drawable="@mipmap/ic_launcher_monochrome" />
</adaptive-icon>
"""
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())
+39
View File
@@ -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
}
}