Skip to content

feat: add 'auto' color option for system-adaptive widget tint#9

Open
giuseppebisemi wants to merge 2 commits into
hefeicoder:mainfrom
giuseppebisemi:feat/auto-color-option
Open

feat: add 'auto' color option for system-adaptive widget tint#9
giuseppebisemi wants to merge 2 commits into
hefeicoder:mainfrom
giuseppebisemi:feat/auto-color-option

Conversation

@giuseppebisemi
Copy link
Copy Markdown

What and why

The available widget colors are all fixed values (green, orange, blue, etc.). This works well for colorful setups, but leaves no option for users who want the widgets to blend naturally with the menu bar — matching the same color used by icons and text.

This PR adds an auto option that maps to NSColor.labelColor: white on a dark menu bar, black on a light one, always in sync with the system appearance.

Change

One line in AppConfig.swift:

case "auto": return .labelColor

And the config comment updated accordingly:

# Options: auto | green | orange | blue | red | purple | yellow | pink | teal

Usage

cpu_color: auto
memory_color: auto
gpu_color: auto

Tested

  • Dark menu bar: widgets render white, matching icons and text
  • Light menu bar: widgets render black, matching icons and text
  • Existing color values unaffected

Giuseppe Bisemi added 2 commits April 7, 2026 17:09
The explicit CGContext flip (translateBy + scaleBy y:-1) was causing
asymmetric SF Symbols like 'display' to render upside-down. Symmetric
symbols (cpu, memorychip) were unaffected visually, masking the bug.

Removing the manual transform and passing rect directly to clip(to:mask:)
lets the existing CTM handle orientation correctly.
Adds a new color value 'auto' that maps to NSColor.labelColor,
which automatically adapts to the system appearance (white on dark
menu bar, black on light menu bar) — matching icon and text colors.

Usage in config.yaml:
  cpu_color: auto
  memory_color: auto
  gpu_color: auto
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