| Ticket UUID: | 2a2dc34e084295d6f6ea5c134554d7329d0750ed | |||
| Title: | Mac OS: Question: Is there a way to get the color of the menu bar? | |||
| Type: | RFE | Version: | 8.6.10 | |
| Submitter: | bll | Created on: | 2020-09-26 16:46:44 | |
| Subsystem: | 66. Aqua Window Operations | Assigned To: | nobody | |
| Priority: | 5 Medium | Severity: | Minor | |
| Status: | Closed | Last Modified: | 2020-09-26 19:48:46 | |
| Resolution: | Works For Me | Closed By: | bll | |
| Closed on: | 2020-09-26 19:48:46 | |||
| Description: |
Is there a way to retrieve the current color of the mac menu bar? When I was researching mac colors, I didn't find a way, but that doesn't mean there isn't one. This is obviously minor, don't spend too much time on it. | |||
| User Comments: |
bll added on 2020-09-26 19:48:46:
bll-mac:/Volumes/Users/bll/Applications/BallroomDJ.app/Contents/MacOS/src$ rlwrap ../darwin/64/tcl/bin/tclsh
% load macmenubarcolor.dylib
% info commands macmenu*
macmenubarcolor
% macmenubarcolor
#2f181a
% time {macmenubarcolor} 200
33548.08365 microseconds per iteration
% puts [expr {33548.0 / 1000.0 / 1000.0}]
0.033548
%
bll added on 2020-09-26 19:28:31: And yet: bll-mac:/Volumes/Users/bll/Applications/BallroomDJ.app/Contents/MacOS/src$ time ./macmenubarcolor #31191a real 0m0.095s user 0m0.026s sys 0m0.012s So it's a little expensive, but 0.1s isn't too bad. Since it's not too bad, I will turn this into a package. bll added on 2020-09-26 19:26:20: See attached. bll added on 2020-09-26 17:17:47: This may be one way. It's only good for a one-time capture, which would be fine for me. I wouldn't want to run this every time the program starts. It's in PyObjC, so I will have to somehow translate it to pure objective C and make it work. https://stackoverflow.com/questions/12978846/python-get-screen-pixel-value-in-os-x | |||