I am currently developing a menu bar application that shows a PNG symbol in the menubar. In Catalina, the PNG was always visible due to the menu bar being more opaque. However, in Big Sur, when a light wallpaper is used, the PNG symbol is not legible. This is because of the menu bar adapting to the wallpaper instead of the Aqua theme.
I have found a way of applying a shadow on the button so that the symbol is legible even with light a wallpaper. In order to apply this shadow only when the legibility is low (i.e. light wallpaper and menu bar) I need to know when the menu bar is light/dark. Is there an API I can use to determine when the menu bar is light and dark so I can apply the shadow only when needed?
I am using the image property of NSStatusBarButton (inherited from NSButton) to place the image in the menu bar.
I have found a way of applying a shadow on the button so that the symbol is legible even with light a wallpaper. In order to apply this shadow only when the legibility is low (i.e. light wallpaper and menu bar) I need to know when the menu bar is light/dark. Is there an API I can use to determine when the menu bar is light and dark so I can apply the shadow only when needed?
I am using the image property of NSStatusBarButton (inherited from NSButton) to place the image in the menu bar.