Skip to content

Feature/dynamic colors#304

Draft
chrisjensen wants to merge 3 commits intosirmalloc:mainfrom
chrisjensen:feature/dynamic-colors
Draft

Feature/dynamic colors#304
chrisjensen wants to merge 3 commits intosirmalloc:mainfrom
chrisjensen:feature/dynamic-colors

Conversation

@chrisjensen
Copy link
Copy Markdown

No description provided.

Extend the Widget interface with getEffectiveColor() and getDiscreteValues()
so widgets can resolve their own foreground color based on current value.

Model widget maps color per model family (Sonnet, Opus, Haiku) using either
explicit colorMap metadata or a hash-based fallback. ThinkingEffort maps
color per effort level (low=green, medium=yellow, high=brightRed, max=red).

Adds color utilities: getThresholdColor for percent-based coloring,
hashStringToColor for deterministic color assignment, and a
DISCRETE_COLOR_PALETTE of visually distinct ANSI colors.

The renderer now calls resolveWidgetFgColor() in both standard and
powerline paths, checking getEffectiveColor before falling back to
the configured or default color.
Usage widgets in progress mode now change color based on usage percent:
green below 50%, yellow between 50-80%, red above 80%. Thresholds are
configurable via metadata (thresholdLow, thresholdHigh).

Adds a (t)hreshold colors toggle keybind in the widget editor to let
users disable the behavior. Threshold colors are enabled by default.
The color menu now cycles through a "Dynamic" option for widgets that
support discrete values. Pressing Enter on a dynamic widget opens a
per-value color editor where each value (e.g. Sonnet, Opus, Haiku)
can be assigned an individual color via left/right arrow keys.

Adds cycleWithDynamic to handle the extended color list and
setDiscreteValueColor/clearDiscreteValueColor mutation helpers.
@chrisjensen chrisjensen marked this pull request as draft April 14, 2026 02:38
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant