Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

Is it possible to control the amount of vibrancy of the translucent/blurry background in Yosemite?

I would like to know whether it is possible to control the amount of translucency in the so-called vibrancy effect introduced recently by Yosemite, which can be implemented in an Objective-C app by employing the NSVisualEffectView class.

Here is an example to be more specific. Consider the translucent effect which is shown by Yosemite OS X when the volume level is changed:

Yosemite

The vibrancy is much stronger than what one obtains by using a simple NSVisualEffectView (shown in the following image)

NSVisualEffectView

If we compare the two images — please, ignore the different form of the speakers but focus on the background — we see that the amount of vibrancy (the strength in the Gaussian blurring effect) is much stronger in the Yosemite OS X volume window instead of my app using NSVisualEffectView. How can one obtain that?

like image 401
Andrea Alberti Avatar asked Nov 15 '14 22:11

Andrea Alberti


1 Answers

In OS X Yosemite Apple introduced new materials that can be applied to NSVisualEffectView.

From the AppKit Release Notes for OS X v10.11:

NSVisualEffectView has additional materials available, and they are now organized in two types of categories. First, there are abstract system defined materials defined by how they should be used: NSVisualEffectMaterialAppearanceBased, NSVisualEffectMaterialTitlebar, NSVisualEffectMaterialMenu (new in 10.11), NSVisualEffectMaterialPopover (new in 10.11), and NSVisualEffectMaterialSidebar (new in 10.11). Use these materials when you are attempting to create a design that mimics these standard UI pieces. Next, there are specific palette materials that can be used more directly to create a specific design or look. These are: NSVisualEffectMaterialLight, NSVisualEffectMaterialDark, NSVisualEffectMaterialMediumLight (new to 10.11), and NSVisualEffectMaterialUltraDark (new to 10.11). These colors may vary slightly depending on the blendingMode set on the NSVisualEffectView; in some cases, they may be the same as another material.

Even though this only applies for OS X El Capitan, you can now create a more "close to original" blur effect for your view. I assume Apple uses the NSVisualEffectMaterialMediumLight material for its volume view.

like image 117
mangerlahn Avatar answered Nov 15 '22 21:11

mangerlahn