0

I have a status bar application. The problem is that my icon stay white at all times. Is there a way to make it go white on dark background and black on light backgrounds. I notice that must status bar apps have this feature

class AppDelegate: NSObject, NSApplicationDelegate {
    static private(set) var instance: AppDelegate!
    lazy var statusBarItem = NSStatusBar.system.statusItem(withLength: NSStatusItem.variableLength)
    let menu = ApplicationMenu()
    
    func applicationDidFinishLaunching(_ notification: Notification) {
        AppDelegate.instance = self
        statusBarItem.button?.image = NSImage(named: NSImage.Name("E22"))
        statusBarItem.button?.imagePosition = .imageLeading
        statusBarItem.menu = menu.createMenu()
    }
}

enter image description here

HangarRash
  • 7,314
  • 5
  • 5
  • 32
Jerry Seigle
  • 417
  • 4
  • 12
  • 2
    Does this answer your question? [NSStatusItem change image for dark tint](https://stackoverflow.com/questions/24623559/nsstatusitem-change-image-for-dark-tint) – HangarRash Jan 16 '23 at 00:04

0 Answers0