cocoa - What's the relationship between NSAppearance, NSEffectView.Material, and "Vibrancy" -
as in question title, what's relationship between nsappearance
, nseffectview.material
, , "vibrancy"? i've found through experimentation that, materials, choice of nsappearance
can change how material appears (e.g. nseffectview.material.titlebar
light or dark depending on active nsappearance
), while other materials (e.g. .light
) don't seem care.
i suspect materials .titlebar
proxies select .dark
, .ultradark
, .light
, , .mediumlight
depending on nsappearance
, seem role of .appearancebased
. see in description nsappearance.name.vibrantlight
...
this should set on nsvisualeffectview or 1 of subviews.
...which contradicts statement nseffectview
documentation...
the view’s effective appearance must allow vibrancy... in cases set appearance on window or on visual effect view—subviews inherit appearance.
...suggesting correct set vibrantlight
nsappearance
of entire window (if that's wanted).
finally, i'm confused "vibrancy" is; if explain it, great.
so nsappearance describes styling of controls, colors, etc view hierarchy appearance set against.
nsvisualeffectview provides way achieve 2 effects: translucency , vibrancy. former more obvious, translucent sidebars or titlebars. , documentation has nice description of vibrancy:
vibrancy associated translucency. describes compositing mode special blending such plus lighter, plus darker, color dodge, or color burn.
basically describing how content (text, images, etc) within visual effect view composited against translucency.
so how these relate?
material
material describes of translucency effect. pointed out, affected nsappearance, not. ones semantically describe usage custom ui can resemble effect regardless of appearance (.appearancebased
, .titlebar
, .menu
, .popover
, .sidebar
, .selection
) whereas others allow specific control on resulting translucency (.light
, .dark
, .mediumlight
, .ultradark
) should used in conjunction associated nsappearance content within visual effect view can match translucency effect. unless need specific control on material, using appearance-sensitive / semantic ones can result more standard ui.
vibrancy
so in order content vibrancy effects nsvisualeffectview can provide, needs used in conjunction vibrant appearance: .vibrantlight
or .vibrantdark
. without setting "vibrant" appearance, nsvisualeffectview provide translucency effect in background, , content within plain , not have special blending modes see in sidebars or titlebars.
Comments
Post a Comment