11

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?

dehrg
  • 1,721
  • 14
  • 17
Andrea Alberti
  • 186
  • 1
  • 9

2 Answers2

1

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.

mangerlahn
  • 4,746
  • 2
  • 26
  • 50
0

I achieve this effect as follows

  1. have a NSVisualEffect view to get vibrancy
  2. have a custom view on top of the visual effect view the same size
  3. set the background color of the custom view to white and alpha of 0 (completely transparent)
  4. increase the alpha of the custom view to make it less translucent (less blurry)