Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

How to access the system selected menu item blue color?

I'm working on an app that has a custom NSView on a NSStatusBar which performs all of the drawing when the user clicks it. But here's the problem, the color I'm currently drawing as the view's background color is not the same as the system blue color.

My app's color:
enter image description here

Twitter's menu item color (system):
enter image description here

As you clearly see, my blue color is way lighter than the system. This is the code I'm currently using (and worked perfectly on versions older than Yosemite):

[[NSColor selectedMenuItemColor] set]; NSRectFill(rect); 

I've even tried color picking the menu item's color but it seems like the color is affected by the wallpaper below the menu bar.
Any ideas on how to achieve the system look?

like image 558
Pedro Vieira Avatar asked Apr 04 '15 04:04

Pedro Vieira


1 Answers

As you said, in Yosemite, docks, status bars etc. are affected by whatever is behind them. Try enabling System Preferences > Accessibility > Display > Reduce Transparency and you'll see what your color looks like without this feature./

like image 56
simurg Avatar answered Sep 20 '22 07:09

simurg