Theme tiers 1-2: theme folders, mascot recolour, background scene and tile, frame sets, picture threads, sounds; nine new built-in themes
- ThemeAssets loads a theme's files; FrameSet + GradientMap (3-stop) generalise the card frame;
ThreadStrip draws threads from a picture; BoardBackdrop draws scene and tile; MascotArt
recolours Morgan by role (logo SVG now uses the Keep File importer); SoundBoard plays
roll / card turn / thread / click / ambient with View > Sound levels.
- Vaporwave, Synthwave, Cozy Autumn, Rustic, Woodsy, Sky Blue, Frutiger Aero, Gothic, Terminal:
generated art (tools/theme_art), sounds (tools/theme_sounds), settings (tools/theme_defs).
- Ten OFL fonts; --theme=<id> flag; docs/THEMES.md format spec; test_theme_assets.
Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
2026-11-11 15:05:40 -06:00
|
|
|
"""Regenerate the stand-in theme art for every theme, plus tools/theme_art/meta.json.
|
|
|
|
|
|
|
|
|
|
Run from anywhere: python3 -I tools/theme_art/make_theme_art.py
|
|
|
|
|
Writes themes/<id>/{background_tile, background_scene, frame_corner, frame_corner_fixed, frame_edge,
|
|
|
|
|
thread_strip}.svg. Files a theme does not use are removed, so a re-run always matches the plan.
|
|
|
|
|
"""
|
|
|
|
|
|
|
|
|
|
import json
|
|
|
|
|
import os
|
|
|
|
|
import sys
|
|
|
|
|
|
2026-11-11 15:40:10 -06:00
|
|
|
sys.dont_write_bytecode = True # keep __pycache__ out of the repo
|
Theme tiers 1-2: theme folders, mascot recolour, background scene and tile, frame sets, picture threads, sounds; nine new built-in themes
- ThemeAssets loads a theme's files; FrameSet + GradientMap (3-stop) generalise the card frame;
ThreadStrip draws threads from a picture; BoardBackdrop draws scene and tile; MascotArt
recolours Morgan by role (logo SVG now uses the Keep File importer); SoundBoard plays
roll / card turn / thread / click / ambient with View > Sound levels.
- Vaporwave, Synthwave, Cozy Autumn, Rustic, Woodsy, Sky Blue, Frutiger Aero, Gothic, Terminal:
generated art (tools/theme_art), sounds (tools/theme_sounds), settings (tools/theme_defs).
- Ten OFL fonts; --theme=<id> flag; docs/THEMES.md format spec; test_theme_assets.
Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
2026-11-11 15:05:40 -06:00
|
|
|
sys.path.insert(0, os.path.dirname(os.path.abspath(__file__)))
|
|
|
|
|
|
|
|
|
|
from frame_styles import FRAME_STYLES # noqa: E402
|
|
|
|
|
from frames import corner_fixed_svg, corner_svg, edge_svg, frame_meta # noqa: E402
|
|
|
|
|
from scenes import make_background_scene # noqa: E402
|
|
|
|
|
from svg_common import remove_theme_file, write_theme_file # noqa: E402
|
|
|
|
|
from theme_colours import THEMES # noqa: E402
|
|
|
|
|
from threads import make_thread_strip # noqa: E402
|
2026-11-11 15:40:10 -06:00
|
|
|
from threads_more import PIN_SIZE_PX, pushpin_svg # noqa: E402
|
Theme tiers 1-2: theme folders, mascot recolour, background scene and tile, frame sets, picture threads, sounds; nine new built-in themes
- ThemeAssets loads a theme's files; FrameSet + GradientMap (3-stop) generalise the card frame;
ThreadStrip draws threads from a picture; BoardBackdrop draws scene and tile; MascotArt
recolours Morgan by role (logo SVG now uses the Keep File importer); SoundBoard plays
roll / card turn / thread / click / ambient with View > Sound levels.
- Vaporwave, Synthwave, Cozy Autumn, Rustic, Woodsy, Sky Blue, Frutiger Aero, Gothic, Terminal:
generated art (tools/theme_art), sounds (tools/theme_sounds), settings (tools/theme_defs).
- Ten OFL fonts; --theme=<id> flag; docs/THEMES.md format spec; test_theme_assets.
Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
2026-11-11 15:05:40 -06:00
|
|
|
|
|
|
|
|
META_PATH = os.path.join(os.path.dirname(os.path.abspath(__file__)), "meta.json")
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
def write_or_remove(theme_id, file_name, text):
|
|
|
|
|
if text is None:
|
|
|
|
|
remove_theme_file(theme_id, file_name)
|
|
|
|
|
else:
|
|
|
|
|
write_theme_file(theme_id, file_name, text)
|
|
|
|
|
|
|
|
|
|
|
2026-11-11 15:40:10 -06:00
|
|
|
def write_background_tile(theme_id, pattern):
|
|
|
|
|
"""Write the tile (SVG, or PNG for marble, which needs noise SVG cannot draw in ThorVG); return its meta."""
|
|
|
|
|
if pattern["kind"] == "marble":
|
|
|
|
|
from marble_tile import make_marble_png # only this tile needs numpy
|
Theme tiers 1-2: theme folders, mascot recolour, background scene and tile, frame sets, picture threads, sounds; nine new built-in themes
- ThemeAssets loads a theme's files; FrameSet + GradientMap (3-stop) generalise the card frame;
ThreadStrip draws threads from a picture; BoardBackdrop draws scene and tile; MascotArt
recolours Morgan by role (logo SVG now uses the Keep File importer); SoundBoard plays
roll / card turn / thread / click / ambient with View > Sound levels.
- Vaporwave, Synthwave, Cozy Autumn, Rustic, Woodsy, Sky Blue, Frutiger Aero, Gothic, Terminal:
generated art (tools/theme_art), sounds (tools/theme_sounds), settings (tools/theme_defs).
- Ten OFL fonts; --theme=<id> flag; docs/THEMES.md format spec; test_theme_assets.
Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
2026-11-11 15:05:40 -06:00
|
|
|
|
2026-11-11 15:40:10 -06:00
|
|
|
remove_theme_file(theme_id, "background_tile.svg")
|
|
|
|
|
write_theme_file(theme_id, "background_tile.png", make_marble_png(pattern))
|
|
|
|
|
return {"file": "background_tile.png", "opacity": pattern["op"], "scale": 1.0}
|
|
|
|
|
from tiles import make_background_tile
|
|
|
|
|
|
|
|
|
|
remove_theme_file(theme_id, "background_tile.png")
|
|
|
|
|
tile_text, tile_meta = make_background_tile(pattern)
|
Theme tiers 1-2: theme folders, mascot recolour, background scene and tile, frame sets, picture threads, sounds; nine new built-in themes
- ThemeAssets loads a theme's files; FrameSet + GradientMap (3-stop) generalise the card frame;
ThreadStrip draws threads from a picture; BoardBackdrop draws scene and tile; MascotArt
recolours Morgan by role (logo SVG now uses the Keep File importer); SoundBoard plays
roll / card turn / thread / click / ambient with View > Sound levels.
- Vaporwave, Synthwave, Cozy Autumn, Rustic, Woodsy, Sky Blue, Frutiger Aero, Gothic, Terminal:
generated art (tools/theme_art), sounds (tools/theme_sounds), settings (tools/theme_defs).
- Ten OFL fonts; --theme=<id> flag; docs/THEMES.md format spec; test_theme_assets.
Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
2026-11-11 15:05:40 -06:00
|
|
|
write_or_remove(theme_id, "background_tile.svg", tile_text)
|
2026-11-11 15:40:10 -06:00
|
|
|
return tile_meta
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
def build_theme(theme_id, theme):
|
|
|
|
|
"""Write one theme's files and return its meta entry."""
|
|
|
|
|
tile_meta = write_background_tile(theme_id, theme["pattern"])
|
Theme tiers 1-2: theme folders, mascot recolour, background scene and tile, frame sets, picture threads, sounds; nine new built-in themes
- ThemeAssets loads a theme's files; FrameSet + GradientMap (3-stop) generalise the card frame;
ThreadStrip draws threads from a picture; BoardBackdrop draws scene and tile; MascotArt
recolours Morgan by role (logo SVG now uses the Keep File importer); SoundBoard plays
roll / card turn / thread / click / ambient with View > Sound levels.
- Vaporwave, Synthwave, Cozy Autumn, Rustic, Woodsy, Sky Blue, Frutiger Aero, Gothic, Terminal:
generated art (tools/theme_art), sounds (tools/theme_sounds), settings (tools/theme_defs).
- Ten OFL fonts; --theme=<id> flag; docs/THEMES.md format spec; test_theme_assets.
Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
2026-11-11 15:05:40 -06:00
|
|
|
scene_text, scene_meta = make_background_scene(theme["scene"])
|
|
|
|
|
write_or_remove(theme_id, "background_scene.svg", scene_text)
|
|
|
|
|
|
|
|
|
|
style = FRAME_STYLES[theme["frame"]](theme["colours"])
|
|
|
|
|
write_theme_file(theme_id, "frame_corner.svg", corner_svg(style))
|
|
|
|
|
write_theme_file(theme_id, "frame_edge.svg", edge_svg(style))
|
|
|
|
|
write_or_remove(theme_id, "frame_corner_fixed.svg", corner_fixed_svg(style))
|
|
|
|
|
|
|
|
|
|
strip_text, thread_meta = make_thread_strip(theme["thread"])
|
|
|
|
|
write_theme_file(theme_id, "thread_strip.svg", strip_text)
|
2026-11-11 15:40:10 -06:00
|
|
|
has_pins = theme.get("pins", False)
|
|
|
|
|
write_or_remove(theme_id, "thread_pin.svg", pushpin_svg(theme["colours"]) if has_pins else None)
|
|
|
|
|
if has_pins:
|
|
|
|
|
thread_meta["pin_size"] = PIN_SIZE_PX
|
Theme tiers 1-2: theme folders, mascot recolour, background scene and tile, frame sets, picture threads, sounds; nine new built-in themes
- ThemeAssets loads a theme's files; FrameSet + GradientMap (3-stop) generalise the card frame;
ThreadStrip draws threads from a picture; BoardBackdrop draws scene and tile; MascotArt
recolours Morgan by role (logo SVG now uses the Keep File importer); SoundBoard plays
roll / card turn / thread / click / ambient with View > Sound levels.
- Vaporwave, Synthwave, Cozy Autumn, Rustic, Woodsy, Sky Blue, Frutiger Aero, Gothic, Terminal:
generated art (tools/theme_art), sounds (tools/theme_sounds), settings (tools/theme_defs).
- Ten OFL fonts; --theme=<id> flag; docs/THEMES.md format spec; test_theme_assets.
Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
2026-11-11 15:05:40 -06:00
|
|
|
return {"frame": frame_meta(style), "thread": thread_meta,
|
|
|
|
|
"background_tile": tile_meta, "background_scene": scene_meta}
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
def main():
|
|
|
|
|
meta = {theme_id: build_theme(theme_id, theme) for theme_id, theme in THEMES.items()}
|
|
|
|
|
with open(META_PATH, "w", encoding="utf-8") as handle:
|
|
|
|
|
json.dump(meta, handle, indent=2)
|
|
|
|
|
handle.write("\n")
|
|
|
|
|
print(f"Wrote art for {len(meta)} themes; meta in {META_PATH}")
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
if __name__ == "__main__":
|
|
|
|
|
main()
|