Skip to content

feat(menu-bar): add monochrome icon mode with template rendering#16

Open
jeanfw wants to merge 1 commit into
eddmann:mainfrom
jeanfw:feat/monochrome-icon
Open

feat(menu-bar): add monochrome icon mode with template rendering#16
jeanfw wants to merge 1 commit into
eddmann:mainfrom
jeanfw:feat/monochrome-icon

Conversation

@jeanfw
Copy link
Copy Markdown

@jeanfw jeanfw commented May 10, 2026

Summary

Adds an opt-in monochrome mode for the menu bar icon so it matches the system tray's white-on-dark / black-on-light aesthetic instead of standing out with green/orange/red status colours.

  • New Use Colored Status Icon toggle in Settings → General (default off, monochrome).
  • When off, the icon is rendered as a template image (NSImage.isTemplate = true) so macOS tints it to match the menu bar.
  • When on, the original status palette (green → yellow → orange → red, plus purple for the weekly bar in DualBar) is preserved exactly — pixel-perfect against existing snapshots.
  • Colour resolution is centralised in a new MenuBarIconColors helper and threaded through every IconStyle plus the renderer and the cache key.
  • AppSettings stays backwards compatible: a saved settings blob without use_colored_icon decodes with the new field defaulted to off (custom init(from:) falling back to .default).

Why monochrome by default

Most macOS menu bar apps (system, third-party, Apple's own) render their tray icon as a template image so it inherits the menu bar tint. ClaudeMeter's coloured icon sticks out visually next to them. Making monochrome the default brings it in line with the system aesthetic; users who liked the at-a-glance colour-coded status can flip the toggle back on.

Preview

The existing #Preview(\"All Styles\") block still shows the coloured layout. A new #Preview(\"Monochrome\") block renders all six styles in the new mode.

Test plan

  • Open Settings → General; verify the new toggle appears with the description text.
  • With toggle off (default): icon adapts to dark/light menu bar — appears white in dark mode, black in light mode.
  • With toggle on: green at low usage, orange at warning, red at critical, gray when stale (as before).
  • Cycle through all six icon styles in both modes.
  • Existing MenuBarIconRendererTests and MenuBarIconSnapshotTests still pass (colour mode is the default, matches old behaviour).
  • Upgrading from an older build: settings load without error, useColoredIcon initialises to off.

🤖 Generated with Claude Code

Adds a "Use Colored Status Icon" toggle in Settings (default off).
When off, the menu bar icon is rendered as a black-on-clear template
image so macOS tints it to match the system menu bar (white in dark
mode, black in light mode), aligning with the system tray's
monochrome aesthetic. When on, the original green/orange/red status
colours are preserved. Colour resolution is centralised in a new
MenuBarIconColors helper and threaded through every IconStyle plus
the renderer and the icon cache key. AppSettings stays backwards
compatible: an existing serialised settings blob without
"use_colored_icon" decodes with the new field defaulted to off.
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