Logo FS-Skia-UI

Theming Module

Feature 108 (US6, FR-017/018): resolve a theme mode + accent into a role palette and project it back onto the framework `Theme`. Pure, total; never throws.

Functions and values

Function or value Description

resolve mode accent

Full Usage: resolve mode accent

Parameters:
Returns: RolePalette

`mode + accent -> role palette`: the mode seeds the neutral/structural roles from the matching base `Theme` (Light/Dark), the accent overrides the `Accent` and `FocusRing` roles.

mode : ThemeMode
accent : Color
Returns: RolePalette

toTheme palette

Full Usage: toTheme palette

Parameters:
Returns: Theme

Project a role palette onto the framework `Theme` — the "paint theme" passed to the render path (`Control.renderTree`) so the captured palette is EXACT, while the consumer keeps a static `host.Theme` for the fragment-reuse key (FR-018). Non-colour fields (font / density / radius / contrast ratio) carry from `Theme.light`.

palette : RolePalette
Returns: Theme

Type something to start searching.