How to dim os x desktop using Cocoa/Core Animation

2019-02-11 01:27发布

Is there a way to control the brightness of the OS X desktop programmatically using Cocoa or Core Animation?

2条回答
劫难
2楼-- · 2019-02-11 01:43

In case you were actually interested in doing a fade-out or fade-in of the whole screen, here is a link describing how to do that.

The linked document contains examples for how to fade all displays (or a single display) to black (you can change the color), capture the display (where you can display what you'd like), and then fade back. This uses CGAcquireDisplayFadeReservation() mentioned in the comment to my other answer.

Is this more like what you were looking for?

查看更多
贼婆χ
3楼-- · 2019-02-11 01:48

Create a semi-transparent full-screen view behind your main window.

查看更多
登录 后发表回答