MacOs changes the tray icon colors depending on th...
# compose-desktop
a
MacOs changes the tray icon colors depending on the wallpaper set. I am currently using an svg as my tray icon. is there a way to detect the color and apply the one needed accordingly? I gave isSystemInDarkTheme() a go but those colors are unrelated to the system theme
a
You may want to check if you can set the underlying NSImage to be a template from Swing
Template mode is what will let the icon be themed
a
For future reference, you can do this by calling
System.setProperty("apple.awt.enableTemplateImages", "true")
. the icon will be tinted accordingly on different type of wallpapers on a mac. I ended up using an SVG for my tray icon with a white color so that it works nicely on windows too
a
Perfect 🙂
Template images are the way to go for icons