50 lines
2.1 KiB
Markdown
50 lines
2.1 KiB
Markdown
# pytermgui styling docs — global palette and live regenerate
|
|||
|
|
|
||
|
|
## Metadata
|
||
|
|
|
||
|
|
| Field | Value |
|
||
|
|
|---|---|
|
||
|
|
| Institute | Molodetz Institute — Research & Retrieval Division |
|
||
|
|
| Subject | tui-framework-design |
|
||
|
|
| Document type | Source Dossier |
|
||
|
|
| Tier | 1 |
|
||
|
|
| Source title | pytermgui styling documentation — palette, tags, and widgets |
|
||
|
|
| Source URL | https://github.com/bczsalba/pytermgui/blob/HEAD/docs/widgets/styling.md |
|
||
|
|
| Source publisher / author | bczsalba (pytermgui project) |
|
||
|
|
| Source type | vendor docs |
|
||
|
|
| Source date (published) | Unknown — not stated |
|
||
|
|
| Date researched | 2026-10-11 |
|
||
|
|
| Researched by | tai (agent), model: Muse Spark, on behalf of retoor |
|
||
|
|
| Research method | direct page fetch |
|
||
|
|
| Confidence | Medium |
|
||
|
|
| Status | Active |
|
||
|
|
|
||
|
|
## Summary
|
||
|
|
|
||
|
|
The simplest theme model surveyed: one global palette regenerated live from a single primary color (`palette.regenerate(primary)`), shade offsets derived from it, and markup tags (`@bg`, `#auto`) resolving against the palette. The live-regenerate spirit is the portable idea.
|
||
|
|
|
||
|
|
## Key findings
|
||
|
|
|
||
|
|
- A single global palette regenerates live from one primary color via `palette.regenerate(primary)`; shades derive as offsets.
|
||
|
|
- Markup tags (`@bg`, `#auto`) resolve colors against the current palette at render time.
|
||
|
|
|
||
|
|
## Pros / strengths
|
||
|
|
|
||
|
|
- Minimal possible theme API: one color in, whole palette out, live.
|
||
|
|
- Tag-based palette resolution is the same resolve-at-draw idea as ratatui-kit's derivation, in markup form.
|
||
|
|
|
||
|
|
## Cons / limitations / caveats
|
||
|
|
|
||
|
|
- One primary color cannot express tai's semantic roles (success/warning/error/info need independent hues); tai needs the fuller role set.
|
||
|
|
- pytermgui `NO_COLOR` support details were seen in snippet only, not fetched — not claimed here.
|
||
|
|
|
||
|
|
## Relevance to tai
|
||
|
|
|
||
|
|
- Contributes the live-regenerate spirit (a switch repaints everything immediately, via tai's full redraw) and the shade-offset idea to the palette-role conclusion; its single-primary limit is why tai adopts 12 roles instead.
|
||
|
|
|
||
|
|
## Changelog
|
||
|
|
|
||
|
|
| Date | Change |
|
||
|
|
|---|---|
|
||
|
|
| 2026-10-11 | Initial dossier created from 2026-10-11 research-pass evidence (body opened via web_fetch by researching agent). |
|