Problem
On macOS, status bar icons often need explicit control over whether the underlying NSImage is rendered as a template image.
For monochrome status bar symbols, template rendering is useful because AppKit can adapt the icon color to light and dark menu bar appearances. For full-color or filled icons, however, template rendering can be undesirable: an image with an opaque filled shape and internal details may render as a single solid status-bar colored block because the image is treated as a mask.
The current tray icon API does not appear to expose a way to opt in or out of this behavior.
Expected behavior
There should be a public API to explicitly choose template rendering behavior for macOS tray icons.
For example, nativeapi could expose one of these concepts:
- an
is_template property on images
- a tray icon image setter that accepts a template-rendering flag
- separate APIs for setting template and non-template tray images
This would allow callers to choose between:
- template icons that adapt to menu bar appearance
- non-template icons that preserve source colors, filled backgrounds, and internal details
Actual behavior
There is no public API to control this. On macOS, filled tray icons can appear as a solid block when template rendering is applied or inferred.
Environment
- Platform: macOS
- API surface: tray icon image assignment
- Affected concept:
NSImage.isTemplate
Suggested fix
Expose template rendering control in the nativeapi image or tray icon API, and map it to NSImage.isTemplate on macOS. Other platforms could ignore the flag or document platform-specific behavior.
Problem
On macOS, status bar icons often need explicit control over whether the underlying
NSImageis rendered as a template image.For monochrome status bar symbols, template rendering is useful because AppKit can adapt the icon color to light and dark menu bar appearances. For full-color or filled icons, however, template rendering can be undesirable: an image with an opaque filled shape and internal details may render as a single solid status-bar colored block because the image is treated as a mask.
The current tray icon API does not appear to expose a way to opt in or out of this behavior.
Expected behavior
There should be a public API to explicitly choose template rendering behavior for macOS tray icons.
For example, nativeapi could expose one of these concepts:
is_templateproperty on imagesThis would allow callers to choose between:
Actual behavior
There is no public API to control this. On macOS, filled tray icons can appear as a solid block when template rendering is applied or inferred.
Environment
NSImage.isTemplateSuggested fix
Expose template rendering control in the nativeapi image or tray icon API, and map it to
NSImage.isTemplateon macOS. Other platforms could ignore the flag or document platform-specific behavior.