Skip to content

feat: add the theme engine to Launcher.Core - #63

Merged
fogrew merged 1 commit into
release/3.0.0from
feature/theme-engine
Oct 27, 2026
Merged

fogrew merged 1 commit into
release/3.0.0from
feature/theme-engine

Conversation

@fogrew

@fogrew fogrew commented Oct 27, 2026

Copy link
Copy Markdown
Member

What

The reference implementation of docs/themes.md in Launcher.Core, with no UI yet:

  • ThemeReader reads theme.json into a ThemeSpec with a dark and a light scheme. It never throws; an unusable file is the default theme, an unusable field is that field's default, and a missing scheme is built from the other one.
  • ThemeReadability resolves a scheme against the launcher's own palette: accent at least 3:1, button label at least 4.5:1 over every fill sample, button edge at least 3:1. A colour keeps its hue and has its lightness moved by the smallest shift that satisfies every rule at once; the result says what was adjusted.
  • ArtDarkening picks the darkening layer for text over art (5% steps up to 55%) from the brightest cell of the area the text covers.
  • ColorSchemeSetting is the player's System/Light/Dark choice, stored in config.ini as ColorScheme; the default is System.

Why now

The Avalonia work (#24) and the theme editor (#60) both need one tested implementation of the rules. The editor's JavaScript will be checked against shared vectors generated from this code.

Tests

55 new tests (Launcher.Tests is now 356, Launcher.Avalonia.Tests 10), including sweeps over 216 colours in both palettes, with and without a border, and 300 random gradients.

Refs #24, #60

🤖 Generated with Claude Code

Read theme.json into light and dark schemes and apply the readability
rules of docs/themes.md: the accent, the button label and edge, and the
darkening layer over art are moved by the smallest lightness shift that
satisfies every rule. Nothing in a theme can fail a profile; whatever is
missing or malformed falls back to its default.

The player's own System/Light/Dark choice is kept in config.ini and
defaults to the system.

Refs #24, #60

Co-Authored-By: Claude Sonnet 5.5 <noreply@anthropic.com>
@fogrew
fogrew merged commit 9515c93 into release/3.0.0 Oct 27, 2026
2 checks passed
@fogrew
fogrew deleted the feature/theme-engine branch October 27, 2026 10:19
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant