Redesign the character palettes from the reference cards

Phase 5a-4. The owner chose candidate B of each palette.

- Harvest Moon uses copper from Holo's tail as the accent, cream from
  the tail tip, and red-brown surfaces.
- Crimson Pilot uses plugsuit red as the accent, orange hair, blue eyes,
  and the yellow dress. Borders are a low-chroma wine. Error is a light
  rose red, so it differs from the accent.
- Silver Serpent uses silver from the grey eyes as the accent, Slytherin
  emerald as the second accent, and charcoal surfaces.
- All eight built-in palettes pass every readability rule. The
  known-failure list in contrast.spec.ts is gone.
- characterPalettes.spec.ts measures text selection as the app draws
  it, at most 65% opaque over the page (UI-029).
- Docs: UI-045, and the character references in ui-color.md.

pnpm check passes. pnpm test: 446 of 446 pass. Full smoke suite: 95
passed, 2 known.
This commit is contained in:
Knotty Wyvern
2026-10-28 17:25:51 -07:00
parent a34c1a5dce
commit 35f39e93f3
10 changed files with 63 additions and 47 deletions
+4 -1
View File
@@ -3,6 +3,7 @@ import assert from 'node:assert/strict';
import { test } from 'node:test';
import { BUILTIN_THEMES } from '../../../src/lib/theme/themes/index.ts';
import { SYNTAX_ROLES, resolveColors } from '../../../src/lib/theme/roles.ts';
import { SURFACES, appliedColors } from '../../../src/lib/theme/contrast.ts';
/** Every role of a dark character palette, with the derived roles. */
function characterTheme(theme: string) {
@@ -26,7 +27,9 @@ function contrast(foreground: string, background: string) {
/** Named foreground groups and surfaces of a palette. Image surfaces are tinted over a white image. */
function roles(theme: string) {
const palette = characterTheme(theme)!;
const { bg, 'bg-elevated': elevated, 'bg-active': active, 'text-dim': dim, text, 'text-strong': strong, accent, selection } = palette;
const { bg, 'bg-elevated': elevated, 'bg-active': active, 'text-dim': dim, text, 'text-strong': strong, accent } = palette;
// The app draws text selection at most 65% opaque over the page (UI-029).
const selection = SURFACES.selection(appliedColors(palette));
const editorOnWhite = mix(bg, '#ffffff', 0.9);
const panelOnWhite = mix(elevated, '#ffffff', 0.82);
const foregrounds = {