Shared system palette
Purpose
Chat, bars, overview, settings, quick settings and the web panels share the same semantic color roles, with the profile color, Matugen and system typography feeding them.
Requirements
Requirement: One shared set of semantic roles
The system SHALL use the same semantic roles in chat, bars, overview, settings, quick settings and the web panels. New consumers MUST use the common roles directly and MUST NOT add another independent family for a new panel. Full text: section Main roles.
Scenario: New panel
- WHEN a new panel needs colors
- THEN it uses the common roles and adds no independent family
Requirement: Profile tones come from the generator
The system SHALL generate the tones with profileTones() in web-shell/core/profile-color.js, keep the block between the profile-color:start and profile-color:end markers equal to the generator, and regenerate it rather than edit it by hand. Full text: section Main roles.
Scenario: Block edited by hand
- WHEN the block differs from the generator
- THEN the test that keeps them equal fails
Requirement: Fixed colors stay fixed
The system SHALL keep the approval dialogs, the lock screen and the default of the application window frames as fixed colors that do not follow the profile color, and a test checks their AA contrast. Full text: section Main roles.
Scenario: Profile color change
- WHEN the user changes the profile color
- THEN the approval dialogs and the lock screen keep their fixed colors
Requirement: Tones keep AA contrast
The system SHALL move the lightness of each tone that carries text until it reaches 4.5:1 (WCAG AA) against every surface where it is used. Full text: section Profile color.
Scenario: Low-chroma color
- WHEN the main color has little chroma
- THEN the text tones still reach 4.5:1 against their surfaces
Requirement: Profile color route
The system SHALL accept only typed actions on POST /api/profile-color, run all actions of one request as one profile-color change of core/changes.js so they apply together or not at all, and refuse a thirteenth saved color before the journal. Full text: section Profile color.
Scenario: Thirteenth saved color
- WHEN a request saves a thirteenth color
- THEN it is refused before the journal
Requirement: Profile color agent tools
The system SHALL let set_profile_color accept one #RRGGBB color and no CSS, and generated HTML MUST NOT get the profile color tools. Full text: section Profile color.
Scenario: Agent sets a color
- WHEN the agent calls
set_profile_colorwith a color - THEN it saves (when asked), sets the color and closes the first-run card in one change, with no approval
Requirement: Wallpaper palette precedence
The system SHALL let an applied Matugen wallpaper palette win over the profile color, with the shell-wallpaper layer after shell-profile so the two palettes do not mix. Full text: section Profile color.
Scenario: Palette applied
- WHEN a wallpaper palette is applied
- THEN it wins over the profile color
Requirement: Compositor visual style is authorized only through the core
The system SHALL send the typed command visual_style only from the core; no agent tool, MCP entry, generated HTML, scheduled turn or plugin sends the command or another value. The lock frame of the compositor stays black. Full text: section Compositor.
Scenario: Agent changes the accent
- WHEN the agent wants a different accent
- THEN it goes only through the already authorized palette paths with validated
#RRGGBBcolors
Requirement: Personal CSS is preserved
The system SHALL preserve the personal CSS in the ShadowRoot byte for byte, and fixed colors and local overrides MUST NOT get authority over the protected controls. Applying a Matugen palette again replaces only the generated block. Full text: section Precedence and preservation.
Scenario: Palette removed
- WHEN a Matugen palette is removed
- THEN the personal CSS is restored
Requirement: Palette verification has no authority
The system SHALL run npm run test:palette against a loopback fixture with synthetic services, without starting the core, OpenCode, Electron or the compositor, and the compositor MUST NOT be restarted to apply palette changes. Full text: section Verification.
Scenario: Browser capture
- WHEN the browser validation passes
- THEN it does not prove that the Electron in use was updated
Requirement: System typography is read-only
The system SHALL read the font-name, monospace-font-name and text-scaling-factor preferences without writing to system preferences, deliver only CSS tokens, and grant the renderer no command and no GSettings access. Full text: section System typography.
Scenario: Bridge unavailable
- WHEN Python3, PyGObject/Gio or Pango, or a valid schema, is missing
- THEN the CSS fallbacks apply
Status
Doc status: current contract. Checked 2026-11-10.
Introduction
Direction of 2026-11-01: chat, bars, overview, settings, quick settings and
the web panels use the same semantic roles. The default main color is violet
(#8b5cf6), which the user asked for ("use uma cor roxa por padrão"). The
user picks the main color of the profile, and the core picks every tone of the
light and the dark mode from it (see Profile color below). Matugen still
changes the colors of these roles from the wallpaper, without changing
components, geometry, fonts, transitions or authority contracts.
The earlier palette (graphite and soft green, 2026-10-29) is history. The inventory of 2026-11-01 found these problems with it: the light mode drew dark text straight on the dark wallpaper, so the welcome text was not readable; the mint accent clashed with the blue and violet default wallpaper; the approval dialogs, the lock screen, the window frame default and about 140 CSS fallbacks repeated the old values by hand; and the CSS wallpaper fallback turned light in the light mode, while the aurora and most wallpapers stay dark.
Main roles
The tones are the output of profileTones() in web-shell/core/profile-color.js
for the default color. theme.css holds them between the
profile-color:start and profile-color:end markers, and a test keeps that
block equal to the generator. Regenerate the block; do not edit it by hand.
| Token | Use | Dark default | Light default |
|---|---|---|---|
--color-background |
Main background | #100e17 |
#f7f6fb |
--color-surface |
Panels and menus | #1a1822 |
#ffffff |
--color-control |
Inactive buttons and tiles | #282633 |
#edebf4 |
--color-hover |
Hover | #322f3f |
#e3e1ed |
--color-selection |
Subtle selection | #372d58 |
#e5e0fe |
--color-text |
Main text | #eeedf6 |
#22202b |
--color-muted |
Secondary text | #b4b1c6 |
#615e70 |
--color-accent |
Active action, focus, accent text | #c0b2fa |
#7146cf |
--color-on-accent |
Text on accent | #221541 |
#ffffff |
--color-accent-hover |
Hover of the active action | #d2c9fd |
#6039b1 |
--color-border |
Dividers and borders | #434051 |
#cecbdb |
--color-error |
Errors | #fdb1aa |
#b02a2d |
--color-error-surface |
Error background | #3e1e1c |
#feebe9 |
Mode-independent roles, in the base :root only:
| Token | Use | Default |
|---|---|---|
--color-top-bar-* |
The top bar, dark in both modes; -solid is its opaque form |
#09080f base, #f2f1f8 text, badge = dark accent |
--color-on-wallpaper, -muted, -accent |
Text drawn straight on the wallpaper (the welcome and the system state line), light in both modes, with a text shadow | #f5f4fb, #d1cee4, #d2c9fc |
--color-wallpaper-* |
The CSS wallpaper fallback (no image and no WebGL effect) and the backdrop of the crystals effect, dark in both modes | violet-tinted dark gradient |
The crystals effect keeps the --color-on-wallpaper text readable with a
local luminance cap: since phase 1.5 of
the crystals spec the shader caps the relative
luminance at 0.088 only behind the text regions that the chat host reports.
Outside them the crystals glow brighter. Unknown regions cap the whole
wallpaper.
--color-glass-surface, --color-glass-start and --color-content-glass are
the surface, control and background tones with alpha. While Smithay blurs
behind the chat surfaces and the message bubbles, --glass-panel-blurred
mixes the panel tone with transparency; see
the chat glass regions. --icon-filter and
--icon-on-accent-filter keep monochrome icons readable. --color-scheme
guides browser controls.
The historical names --color-bar-*, --quick-color-*, --border-* and the
metric/selection aliases stay declared for compatibility, and they reference the
shared palette. New consumers use the common roles directly. Do not add another
independent family for a new panel.
Fixed colors that do not follow the profile color, on purpose: the approval
dialogs (fixed light/dark pairs, so no palette can hide a request), the lock
screen (always dark, it draws before the profile matters), and the default of
the application window frames (set_window_style keeps its own typed colors).
Their values now match the violet default, and a test checks their AA contrast.
Since 2026-11-03 the approval palette also has --approval-hover and
--approval-accent-hover for the hover of its buttons, and its border uses
the default border pair of the system (#cecbdb light, #434051 dark).
Profile color
The user chooses the main color; the system chooses the tones.
web-shell/core/profile-color.jsconverts the main color to OKLCH, keeps its hue, and sets the lightness and chroma of each role with one recipe. The neutrals carry a light tint of the hue, the accent carries most of its chroma, and the error keeps a fixed red hue. Out of sRGB, the chroma goes down until the tone fits. Each tone that carries text then moves its lightness until it reaches 4.5:1 (WCAG AA) against every surface where it is used. A main color with little chroma has little hue to tell the selection from hover, so its selection also moves lightness, more as the chroma goes down (none at chroma 0.1 and above).- The state is
profileColorinstate.json:{color, chosen, saved}. Bad values fall back to the default.savedholds up to 12 colors of the user. /theme.cssappends@layer shell-profile { ... }with the tones for a color other than the default. That layer comes aftershell-theme, so it replaces the defaults. The unlayered Matugen block and the solid material still win over it. The palette revision (wallpaperThemeRevision, 64 hex digits, the only form that Electron loads) is the hash of the colors that/theme.cssappends, so a trusted document reloads its sheet when the profile color or the wallpaper palette changes: the main host (its poll), quick settings (its state), and the notification panels, the top bar and the volume indicator (their/api/system-themereading, every 10 s for the top bar and each time the indicator shows).- Configurações has the section "Cor do perfil": 12 vivid presets, the colors of the user (with a remove button) and "Outra cor" with "Usar e guardar".
- First run: while
chosenis false, an empty chat shows the card "Escolha a cor do seu perfil" above the message field. A swatch applies the color at once, so the user can try several; "Continuar" goes to the second step of the card, the essentials (openspec/specs/usability/spec.md, Onboarding), and "Pronto" there closes the card. A choice in the settings, or a color set by the chat, also closes it. A profile from before this change has noprofileColor, so it sees the card once. - The protected route
POST /api/profile-colortakes only typed actions:{action: "set" | "save" | "remove", color: "#rrggbb"},{action: "done"}, or{actions: [...]}with one to three of them. All actions of one request run as oneprofile-colorchange ofcore/changes.js, with the checkpoint, journal and recovery of the other preferences: they apply together or not at all. A thirteenth saved color is refused before the journal, so it does not show as a failed change. - Matugen stays as the alternative: the wallpaper tools of the chat are
unchanged, and an applied wallpaper palette wins over the profile color.
Matugen sets only the mode tokens, so
/theme.cssalso appends@layer shell-wallpaper { ... }with the mode-independent tones (top bar, default wallpaper, text on the wallpaper) of the Matugen accent. That layer comes aftershell-profile, so the two palettes do not mix, and the solid material still wins over it. The settings and the first-run card show a note while it is applied, and the settings text points to the chat for wallpaper colors. - Keyboard and screen reader: while a request runs, the buttons get
aria-disabledinstead ofdisabled, so the focused swatch keeps the focus; after a rebuild the focus returns to the swatch with the same color, and the live region says "Cor aplicada.". "Pronto" moves the focus to the message field, and a removal moves it to the color field. - The agent tools
read_profile_colorandset_profile_color({color, save?})let the user define the color together with the chat.set_profile_colorsaves (when asked), sets and closes the first-run card in one change. Likeset_window_style, it needs no approval, also after the browser: the tones keep AA contrast and the protected dialogs keep fixed colors, so the impact is cosmetic, and the user asked that the chat can change the palette. They accept one#RRGGBBcolor and no CSS, so the agent cannot produce an unreadable palette. Generated HTML does not get them. - To add or change the presets, edit
profileColorPresetsincore/profile-color.js(a source change, through the review card when the agent does it). The user adds personal colors without a source change.
Limits: the welcome text stays light on a light personal wallpaper, with only
its text shadow to help. Since 2026-11-02 the wallpaper document follows a new
palette live: the core sends the palette revision on the wallpaper event
stream (openspec/specs/hex-crystals-wallpaper/spec.md), the page loads /theme.css again,
and the crystals effect moves its backdrop (--color-wallpaper-start,
-middle, -end, -glow) and its tint (--color-on-wallpaper-accent) to
the new tokens in 600 ms. Every pixel of the crystals stays at a relative
luminance of 0.09 or less, so the three --color-on-wallpaper tokens keep
4.5:1 without their shadow. The CSS fallback takes the new tokens at once.
The aurora keeps its fixed colors.
Compositor
Since the style unification of 2026-11-03 (phase 5) the Smithay compositor draws its
own visuals with the active palette too: the window rim and the opening reveal, the
window corner radius, the Grid drag outline and the clear color. The core sends the
typed command visual_style with three tones, the radius and, to a compositor with capabilities.visualStyleInk, the ink (docs/smithay-development.md,
Visual style from the core). compositorVisualStyle of core/profile-color.js picks
the error and the background from the dark mode, in both system modes, because the
compositor draws over the dark wallpaper and the window frames. To a compositor with
capabilities.visualStyleInk the accent and the ink are those of the active system
mode, and the core sends visual_style again when the mode changes, so a light mode
recolours the rim, the reveal and the outline (theme-packs phase 4b); to an older
compositor the accent stays the dark one. To a compositor with
capabilities.visualStyleShape, a theme with a windowShape in core/ui-themes.js
(Ninja) adds window_shape and the three accents of the theme in the active mode
(themeAccentTones), which cut the application windows and ring them (theme-packs phase
5b); the other themes, and an older compositor, get the style without them:
- with a wallpaper (Matugen) palette applied, its dark
primary,errorandbackground(wallpaperTheme(...).darkofcore/wallpaper-theme.js), as the stylesheet gives it precedence; - else
profileTones(color).dark.accent,.errorand.backgroundof the profile color; - the window radius is
compositorWindowRadius, 16, the--radius-surfaceof the web UI.
The core builds it at start and in notifyPalette, after every authenticated write and
tool call, so a profile color, a Matugen apply or removal, a replace_ui and a recovery
reach the compositor. syncVisualStyle sends it while the compositor reports another
style (also null after a compositor restart), one request at a time, only with
capabilities.visualStyle, also while locked, and waits 5 s after a refusal before it
tries again. The command is a lease: 60 s after the core goes away, the compositor draws
the values of before again. The agent tools set_profile_color and
the Matugen tools change the palette as before; none of them, no MCP entry, generated
HTML, scheduled turn or plugin sends the command or another value; the agent influences
the accent and the background only through those already authorized palette paths
(set_profile_color, the Matugen block of replace_ui), with validated #RRGGBB colors.
A wallpaper palette with an invalid dark tone falls back to the profile color. The approval dialogs
and the lock screen keep their fixed colors: the lock frame of the compositor stays
black.
Precedence and preservation
- The defaults live in
@layer shell-theme. The system mode picks light or dark for all surfaces, including the chat. Without the service, the browser preference is used. The host reads the mode before serving the HTML. It reads it again when it gains focus, when it becomes visible, and at the existing 10-second interval. - An explicit Matugen application provides the same semantic tokens outside the defaults layer. The mode chosen when the palette is applied takes precedence over the system mode until the palette is removed or replaced. There is no need to rewrite all selectors or to create special colors for the bar.
- The personal CSS stays in the ShadowRoot and is preserved byte for byte. Fixed colors and intentional local overrides can keep an area different from the palette. They get no authority over the protected controls. Changes to structure and behavior still require trusted sources and a rebuild.
The Matugen tools keep revision, preview, journal and restoration. Blocks saved in the initial format are validated with the original serializer and adapted only at presentation. Old files and revisions are not migrated on disk. Applying again replaces only the generated block, and removing it restores the personal CSS. History, sessions, applications and effect selection stay unchanged.
Verification
npm run test:palette, in web-shell, serves a loopback fixture with the real
host assets, React and controls, and synthetic services. It does not start the
core, OpenCode, Electron or the compositor, and it has no socket or desktop
authority. The fixture buttons only switch their own local test state. The
Wi-Fi, Bluetooth, Som (Sound) and power profile submenus show synthetic lists;
their actions get an empty response and change nothing.
Verificar cores (Check colors) compares nine computed tokens across the three
surfaces and the minimum 4.5:1 contrast of the text on the panel and of the text
on the active tile. This is not an accessibility certification of every state.
The browser validation covers light/dark defaults, light/dark Matugen palettes,
local color/width customization and removal of the generated layer. The Matugen
fixture is deterministic. The real extraction stays covered by the earlier
integration and can be exercised by the same installed generator.
On 2026-10-29, format:check, check (including the build) and the 216 Node
tests passed. Generation with the installed Matugen binary was also exercised
with a synthetic wallpaper.
Old snapshots are covered by a fixed text fixture in the Node tests.
Captures use only synthetic content and stay outside Git, in
~/.codex/artifacts/qa/agent-native-os/. The macOS Keychain for R2 is not
reachable on this Linux host. The local evidence has no published public URL.
Publishing, preparing the active checkout and activation are separate steps. A browser capture does not prove that the Electron in use was updated, and it does not prove physical control of the system. Do not restart the compositor to apply palette changes.
System typography
The three surfaces use the font-name, monospace-font-name and
text-scaling-factor preferences of org.gnome.desktop.interface. The optional
bridge core/system-typography.py uses Gio.Settings and the native Pango parser
to split family, styles and size, including names with spaces and sizes in
points/px. The core delivers only CSS tokens. No command and no GSettings access
is granted to the renderer.
--font-family-ui and --font-family-quick receive the same family. Code uses
--font-family-mono. The semantic sizes keep their proportion. They take 15px
as the project base, convert the interface size from points to CSS px (96/72)
and apply the text scale. Code keeps 0.9em to preserve the chat hierarchy, using
the monospace family chosen in the system. The semantic weight/italic styles of
the components stay their own.
The read has a 5-second cache and follows the existing refresh of the host (10 seconds/focus/visibility) and of the controls (15 seconds). It does not write to the system preferences. Python3, PyGObject/Gio and Pango are optional for this bridge. Without them, or without a valid schema, the CSS fallbacks apply, which are now the same for chat and controls. There is no dependency on an open GNOME Shell session. The personal CSS keeps taking precedence in the ShadowRoot, including family and size. Matugen keeps changing only colors.
References: Gio.Settings,
Pango font descriptions
and the GNOME schema installed at /usr/share/glib-2.0/schemas/org.gnome.desktop.interface.gschema.xml.
Context is unavailable on this host. The official documentation and the local
schema were consulted. No rendering parity with GNOME Shell/St is promised.
The palette of Ninja (2026-11-13)
While the experimental window theme Ninja is on, its one fixed palette replaces a Matugen palette
in /theme.css: accent 1 is the profile color (mint #4FE3C2 when none was chosen), accents 2 and 3
are coral #FF7B72 and amber #F2B84B, and the neutrals are fixed per mode (dark: Grafite #1C1F24
surfaces on Fumaça #0E1116, Marfim #EAE7DD text; light: #F7F5EF surfaces on #ECE9E1, #1C1F24 text).
The core builds the roles from accent 1, then writes the neutrals, --theme-accent-1..3,
--theme-on-accent and the accent role as later rules of the same selectors
(themePaletteCSS of core/profile-color.js), each accent at 3:1 or more against the neutral
plates of each mode and --theme-on-accent at 4.5:1 on each. set_profile_color says that the
color is the main accent there. In Office and Galaxy the three accent tokens equal
--color-accent.