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