-
Notifications
You must be signed in to change notification settings - Fork 89
Open
Labels
enhancementNew feature or requestNew feature or request
Description
Feature Request: Dynamic Color Based on Widget Values
Add support for widgets to dynamically change color based on their current value ranges.
Example Use Case
Context percentage widgets that change color based on usage:
- Low usage (0-50%): Green
- Medium usage (50-80%): Yellow
- High usage (80-100%): Red
Current State
Widgets currently use static colors defined in getDefaultColor() method or user-configured colors. The color system supports:
- Static widget colors via
getDefaultColor() - User overrides via
colorproperty - Global color overrides
- Powerline theme colors
Proposed Solution
Add optional dynamic color capability to Widget interface:
- New optional method
getDynamicColor(value, item, context, settings) - Fallback to existing static color system when not implemented
- Configuration for color thresholds/ranges per widget type
- Support for both foreground and background dynamic colors
Benefits
- Visual feedback for important metrics (context usage, token limits)
- Improved at-a-glance status recognition
- Maintains backward compatibility with existing configurations
Implementation Considerations
- Should respect user color overrides and global settings
- Work with both regular and powerline rendering modes
- Consider terminal color capability (16/256/truecolor)
- Allow configuration of thresholds per widget instance
I would like to work on this, if you want to.
Metadata
Metadata
Assignees
Labels
enhancementNew feature or requestNew feature or request