CGColor
public extension CGColor
-
Create a
CGColorfrom aMaterialColorlet view = NSView() view.layer.borderColor = .material(.red400)Declaration
Swift
static func material(_ color: MaterialColor, alpha: CGFloat = 1.0) -> CGColorParameters
colorThe
MaterialColoralphaThe alpha value. Optional.
Return Value
The
CGColor -
The color as a
MaterialColor, or nil if the color cannot be represented as aMaterialColorDeclaration
Swift
var asMaterialColor: MaterialColor? { get }
CGColor Extension Reference