MCPcopy Create free account
hub / github.com/agentforce314/clawcodex / get_palette

Function get_palette

src/utils/theme.py:193–205  ·  view source on GitHub ↗

Return a palette by name with graceful fallback. ``auto`` runs :func:`resolve_auto_theme` to pick between ``dark`` and ``light`` at boot. Unknown names fall back to ``dark``.

(name: str | None, *, env: dict[str, str] | None = None)

Source from the content-addressed store, hash-verified

191
192
193def get_palette(name: str | None, *, env: dict[str, str] | None = None) -> Palette:
194 """Return a palette by name with graceful fallback.
195
196 ``auto`` runs :func:`resolve_auto_theme` to pick between ``dark``
197 and ``light`` at boot. Unknown names fall back to ``dark``.
198 """
199
200 if not name:
201 return DARK
202 key = name.strip().lower()
203 if key == "auto":
204 return _PALETTES.get(resolve_auto_theme(env=env), DARK)
205 return _PALETTES.get(key, DARK)
206
207
208def textual_css_overrides(palette: Palette) -> str:

Callers 1

Calls 2

resolve_auto_themeFunction · 0.85
getMethod · 0.45

Tested by 1