Which method allows me to apply larger-than-default rounded corners to a macOS window while maintaining the system’s dynamic, contrasting border – similar to what’s seen in the Control Center popup? (Control Center has a corner radius of 16, the default system window is 10.)
While I know how to closely achieve this effect manually for my plain panel, I'd like to leverage the built-in method and get it for free from the OS.
I’ve spent way more time on this problem than I'm willing to admit, and searched extensively, but haven’t found any solution. I’d really appreciate any pointers.
Thank you.
I’ve reverse engineered the macOS inner rim stroke color used for windows, popovers, menus, etc., and the value appears to be …
Color(red: 26 / 255, green: 26 / 255, blue: 26 / 255).blendMode(.plusLighter)
… which corresponds to the NSColor.gridColor
value in dark mode.
In usage:
.background(.ultraThinMaterial.materialActiveAppearance(.active))
.overlay {
RoundedRectangle(cornerRadius: 16)
.strokeBorder(Color(red: 26 / 255, green: 26 / 255, blue: 26 / 255)
.blendMode(.plusLighter))
}
I hope this will be of use to someone in the future.