- Every interface string of Project Management goes through the catalog: 539 new rows with fr, ja, and zh-CN. - Storage and model messages use a local message() marker and stay free of host imports. The interface translates them. - A board renders again when the language changes. Dates use the interface language. - Fix: the ribbon button waits for the feature switches at startup, and the settings code loads no feature module. - Add six smoke tests: board state, cards, menus, drag and drop, views, and language. - Add docs/guides/project-management.md and UI-060. Update the user, plugin, SDK, host, development, and interface docs and CLAUDE.md. - Name the fake board view of tree/renameUndo "Board fixture", because the native Project Management button is now in the ribbon.
111 lines
8.7 KiB
Markdown
111 lines
8.7 KiB
Markdown
# Functional color
|
|
|
|
[Interface design](ui-design.md) · [Design decisions](design-decisions.md)
|
|
|
|
This guide sets the color rules for RuneStone and its plugins, for human developers and agents.
|
|
Agents also apply the user-level `ui-functional-color` skill. This guide adds the project roles, references, thresholds, and evidence.
|
|
|
|
## Default
|
|
|
|
- Start accents, priority, status, selection outlines, syntax, and important data with vivid, distinct candidates. Full saturation and full HSV value are normal options.
|
|
- Pick the stronger candidate when readability, meaning, and distinction stay correct.
|
|
- Do not soften a color only to look quiet, refined, professional, premium, minimal, or cohesive. A softer choice needs a concrete reason and before-and-after evidence.
|
|
- A quiet layout comes from spacing, hierarchy, and the amount of color on screen. It does not need a faded palette.
|
|
- Existing muted values are not an approved soft design.
|
|
- Keep informative text and symbols opaque.
|
|
|
|
## Roles and tokens
|
|
|
|
A theme is data. Each built-in theme is one file in `src/lib/theme/themes/`, with one palette for each mode that it offers.
|
|
`src/lib/theme/roles.ts` lists the color roles. Each role is the CSS token `--rs-<role>`.
|
|
A theme gives the base roles. One rule for all themes fills each other role from the base roles, unless the theme gives a value.
|
|
No code outside the theme data names a theme ID. `tests/unit/theme/contrast.spec.ts` checks this.
|
|
|
|
Correct a wrong color in the theme data or in the derivation rule. Do not add local saturation or opacity overrides.
|
|
|
|
| Role | Tokens | Requirement |
|
|
| --- | --- | --- |
|
|
| Theme identity | `--rs-accent`, `--rs-accent-2` | Keep the characteristic hues of the reference at their strength. |
|
|
| Status | `--rs-error`, `--rs-warn`, `--rs-warn-hot`, `--rs-ok` | Use clear, assertive colors. Pair color with a shape or text. |
|
|
| Priority (Project Management) | `--pm-priority-color` in `src/lib/features/pm/ui/style.css` | Full saturation and value, with opaque symbols and readable text. |
|
|
| Links and actions | `--rs-link` (from `--rs-accent` unless the theme sets it) | Keep actionable text distinct and readable on its actual surface. |
|
|
| Text on an accent fill | `--rs-on-accent` (black or white, whichever is more readable) | Readable text and icons on accent buttons and badges. |
|
|
| Focus | `--rs-focus` (from `--rs-accent` unless the theme sets it) | A visible outline on every surface. |
|
|
| Selection | `--rs-item-selection-*`, `--rs-selection`, `--rs-selection-text` | Show a clear state change and boundary. Content inside the selection stays readable. |
|
|
| Highlighted text | `--rs-highlight` | A fill that keeps the text readable. |
|
|
| Syntax | `--rs-syntax-*`, one for each role in `SYNTAX_ROLES` | Give each meaning a distinct color. A palette has at least 7 distinct syntax colors. |
|
|
| Terminal | `--rs-ansi-*` and `--rs-ansi-bright-*`, one for each color in `ANSI_COLORS` | Each color keeps its ANSI hue in every theme. Blue stays blue, also in a red theme. |
|
|
| Surfaces and dividers | `--rs-bg`, `--rs-bg-elevated`, `--rs-bg-active`, `--rs-border`, `--rs-line-highlight`, `--rs-scrim`, `--rs-image-*` tints | Support the content. Choose their strength by function. |
|
|
| Disabled states | Role tokens of the control | Keep labels readable. Do not apply disabled opacity to enabled content. |
|
|
|
|
The Terminal feature uses these tokens directly (`src/lib/features/terminal/theme.ts`). Text is `--rs-text`, the cursor is `--rs-accent` on `--rs-bg`, and the selection is `--rs-selection` with at most 65% alpha. The 16 ANSI colors are the `--rs-ansi-*` tokens. The terminal reads them again after each theme change.
|
|
|
|
Do not fade a whole badge, row, or container when only its background needs transparency.
|
|
Plugins use the same tokens. [Theme tokens](plugin-development.md#theme-tokens) lists them for plugin authors.
|
|
|
|
## Theme references
|
|
|
|
- Read the current reference cards, and obey the source priority that the user gives.
|
|
- RuneStone takes its accent from the rune glow of the app icon (`src-tauri/icons/icon.png`). Claude takes its colors from the Anthropic brand guide. Sakura takes its colors from the palette image in its data file.
|
|
- A text role keeps the hue of its reference color. Change only its lightness until it reaches the readability minimum, and call the result an adaptation.
|
|
- Harvest Moon (Holo) uses the current fan art. Removed images do not count for later palette decisions.
|
|
- Crimson Pilot (Asuka) and Silver Serpent (Malfoid) use their reference cards. For Malfoid, the books win over fan art, so the eyes are grey.
|
|
- A character color goes to the accents, the selection, and the syntax roles. Surfaces and borders get low-chroma tints of the character, so status colors stay visible.
|
|
- Take the colors of the character. Exclude scenery, lighting, alternate clothing, and unrelated details.
|
|
- The trading screenshot and the Bloomberg example show clear information and state distinctions. They do not ask for a terminal-like appearance.
|
|
|
|
## Known failures
|
|
|
|
The October 13 review found these problems. The values record that correction. They are not quotas for future themes.
|
|
|
|
| Palette | Problem | Correction |
|
|
| --- | --- | --- |
|
|
| Harvest Moon (Holo) | Marsh green and pink roles did not match the identity. | Warm copper, chestnut, amber, and red |
|
|
| Crimson Pilot (Asuka) | Repeated green and similar cyan roles | Red, orange, yellow, and blue carry distinct meanings. |
|
|
| Silver Serpent (Malfoid) | Sage accent and near-gray syntax | Emerald accent, saturation from about 29% to 76% |
|
|
| Priority marks | Too dark to draw attention | Full saturation and value, with readable text |
|
|
|
|
The [October 13 menu and color review](archive/menu-audit-2026-10-13.md) holds the measurements and the image-surface limits.
|
|
|
|
## Readability rules
|
|
|
|
`src/lib/theme/contrast.ts` holds these rules. `tests/unit/theme/contrast.spec.ts` applies them to every built-in palette. The theme editor can show the same results.
|
|
Each surface is the color that the app draws: a translucent role is composited onto `bg`. Text selection is at most 65% opaque.
|
|
|
|
| Rule | Check | Minimum |
|
|
| --- | --- | --- |
|
|
| `text` | `text`, `text-dim`, and `text-strong` on `bg`, `bg-elevated`, `bg-active`, `selection`, and the item selection fill over `bg-elevated` | 4.5:1 |
|
|
| `accent-text` | `accent`, `accent-2`, and `link` on `bg`, `bg-elevated`, and `bg-active` | 4.5:1 |
|
|
| `status-text` | `error`, `warn`, and `ok` on `bg` and `bg-elevated` | 4.5:1 |
|
|
| `syntax` | Each syntax role on `bg`, `bg-active`, `line-highlight`, and the item selection fill over `bg` (search and selection matches in Source) | 4.5:1 |
|
|
| `ansi` | Red, green, yellow, blue, magenta, and cyan terminal colors, and their bright variants, on `bg` | 4.5:1 |
|
|
| `focus` | `focus` on `bg`, `bg-elevated`, and `bg-active` | 3:1 |
|
|
| `on-accent` | `on-accent` on `accent` | 4.5:1 |
|
|
| `highlight` | `text` on highlighted text | 4.5:1 |
|
|
| `selection-outline` | `accent` on the item selection fill over `bg-elevated` | 3:1 |
|
|
| `status-distinct` | OKLab distance between `accent`, `error`, `warn`, and `ok`, in pairs | 0.1 |
|
|
| `syntax-variety` | Distinct syntax colors | 7 |
|
|
| `light-page` | In a light palette, `bg` is lighter than `bg-elevated` and `bg-active` | — |
|
|
|
|
`accent` on `selection` is exempt from the 4.5:1 text check. Run the tests with `pnpm test`.
|
|
Every built-in palette passes every rule. A palette that fails a rule fails the test.
|
|
`tests/unit/theme/characterPalettes.spec.ts` adds the checks of each character palette, for example over image tints. It measures text selection as the app draws it: at most 65% opaque over the page.
|
|
Over a user image, contrast depends on the composite surface. Measure the 82% and 90% tints over the image that the change uses. Do not claim contrast over every possible image or overlay.
|
|
When contrast fails, change the foreground, background, surface, or role before you reduce color strength.
|
|
|
|
## Evidence for review
|
|
|
|
Record the evidence that the `ui-functional-color` skill lists for each changed role. For RuneStone, also record:
|
|
|
|
- The shared token and the affected controls.
|
|
- Each named palette and appearance that uses the token.
|
|
- Contrast on the actual composite surface, including image tints, overlays, and selected states.
|
|
- Screenshots at normal scale of the content, code, menus, and priority marks where the token appears.
|
|
- For a softer choice, the stronger candidate and the requirement or measured problem that rejected it.
|
|
- Checks that you could not run. Browser mocks do not replace native desktop checks.
|
|
|
|
Correct unexplained muting, or record it as unresolved, before the work moves to Review.
|
|
A deliberate departure needs an exception entry in the [design decision log](design-decisions.md). The entry alone does not authorize it.
|
|
|
|
Decision: [UI-024](design-decisions.md#ui-024--assertive-functional-color-by-default).
|