simvx.core.ui.theme

Shared application theme – single source of truth for colors and layout.

AppTheme extends the base Theme with named attributes covering backgrounds, text, accents, semantic colors, buttons, editor viewports, gizmos, IDE minimap, autocomplete, and scrollbar styling.

SyntaxTheme provides syntax highlighting colours for code editors.

Factory classmethods dark(), light(), and monokai() return pre-configured instances. Module-level get_theme() / set_theme() manage a runtime-swappable singleton.

Usage::

from simvx.core.ui.theme import AppTheme, get_theme, set_theme

theme = get_theme()           # module-level singleton (dark by default)
bg = theme.bg                 # direct attribute access
set_theme(AppTheme.monokai()) # runtime theme switch

Module Contents

Classes

SyntaxTheme

Syntax highlighting colour set for code editors.

AppTheme

Full application theme with named color and layout attributes.

Functions

get_theme

Return the current application theme singleton.

set_theme

Swap the module-level theme singleton.

Data

API

simvx.core.ui.theme.Color4

None

class simvx.core.ui.theme.SyntaxTheme(keyword: simvx.core.ui.theme.Color4 = (0.4, 0.6, 1.0, 1.0), string: simvx.core.ui.theme.Color4 = (0.5, 0.9, 0.5, 1.0), comment: simvx.core.ui.theme.Color4 = (0.5, 0.5, 0.5, 1.0), number: simvx.core.ui.theme.Color4 = (1.0, 0.7, 0.3, 1.0), decorator: simvx.core.ui.theme.Color4 = (1.0, 0.9, 0.4, 1.0), builtin: simvx.core.ui.theme.Color4 = (0.4, 0.9, 0.9, 1.0), normal: simvx.core.ui.theme.Color4 = (0.9, 0.9, 0.9, 1.0))

Syntax highlighting colour set for code editors.

Each attribute is a Color4 tuple used to colour a token category.

Initialization

__slots__

(‘keyword’, ‘string’, ‘comment’, ‘number’, ‘decorator’, ‘builtin’, ‘normal’)

class simvx.core.ui.theme.AppTheme

Bases: simvx.core.ui.core.Theme

Full application theme with named color and layout attributes.

Subclasses :class:Theme so Control.get_theme() still works. All attributes are also written into self.colors / self.sizes so the dict-based get_color() / get_size() API stays valid.

Initialization

classmethod dark() simvx.core.ui.theme.AppTheme

Dark theme (default).

classmethod light() simvx.core.ui.theme.AppTheme

Light theme with bright backgrounds.

classmethod monokai() simvx.core.ui.theme.AppTheme

Monokai-inspired theme.

get_color(key: str, default=(1, 1, 1, 1)) tuple[float, float, float, float]
get_size(key: str, default: float = 0) float
simvx.core.ui.theme.get_theme() simvx.core.ui.theme.AppTheme

Return the current application theme singleton.

simvx.core.ui.theme.set_theme(theme: simvx.core.ui.theme.AppTheme) None

Swap the module-level theme singleton.

All ThemeColour descriptors resolve on access, so widgets automatically pick up the new theme on their next draw call.