Phase 5a-3. The owner chose candidate B of each palette. - Menus are opaque (UI-043, replaces UI-013). With a background image, menus are at least 92% opaque and blur the image. Submenus show as manual popovers in the top layer, so the blur cannot clip them. - In a light palette, the page is the lightest surface, and the side panes have a slight tint (UI-044). - RuneStone uses neutral surfaces and the rune cyan of the app icon. Claude Dark uses the layout of the Claude app. Claude Light uses a white page with brand Light panes and a darker orange for text. Sakura uses Petal Veil for active rows. - All five core palettes pass every readability rule. A text role keeps the hue of its source and changes only its lightness. - The accent-text rule also checks accent-2, because inline code in Read uses it as text. - The root token defaults match RuneStone Dark. pnpm check passes. pnpm test: 447 pass, 5 todo, 0 fail. Full smoke suite: 92 passed, 2 known. editor/markdownPaste and tables/formulas failed one time and passed on retry. workspace/manageTemplates fails about half of its runs, also on the previous commit: the tree menu rebuilds when the template list reloads, and the open submenu closes.
7.9 KiB
Functional color
Interface design · Design decisions
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 the plugin src/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. |
Do not fade a whole badge, row, or container when only its background needs transparency. Plugins use the same tokens. 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.
- 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 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, and selection |
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, and line-highlight |
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.
The test lists the failures of current palettes as todo. A palette change removes its entries. The test fails when a listed rule passes, so the list cannot go stale.
tests/unit/theme/characterPalettes.spec.ts adds the checks of each character palette, for example over image tints.
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. The entry alone does not authorize it.
Decision: UI-024.