0

I know how to make NSStatusBarItem's image for both light and dark mode (by just setting the image as template, image.template = true). Also, to make the button have disable appearance, we can play with appearsDisabled property.

However, there is another interesting thing about NSStatusBarItem. I saw the NSStatusBarButton of Dropbox and Bluetooth have both inactive and active images on top of each other. You can try to pause Dropbox and you will see a pause image clearer than the Dropbox image. Also, when the Bluetooth is connected, you will see three-dots image on top of the Bluetooth image.

I have tried to put white and black colors for the image, even grayscale. But it turned out to be something different. I think it should be something to deal with 2 different images.

How can I have this kind of image on the status bar?

João Oliveira
  • 422
  • 3
  • 17

1 Answers1

0

You can create this effect using different alpha values for pixels in the image. So for the example of dropbox in the paused state, the status bar item has an image where the pixels creating the paused icon are black and fully opaque, and the pixels creating the dropbox logo that appears gray are also black but with alpha 0.5

Noah
  • 46
  • 5