init(uiColor : UIColor)
Creates a color from a UIKit color.
init(nsColor : NSColor)
Creates a color from an AppKit color.
init(cgColor : CGColor)
Creates a color from a Core Graphics color.
Availability 有効性
Technology
var cgColor: CGColor
? { get }
You can get a CGColor
instance from a constant SwiftUI color. This includes colors you create from a Core Graphics color, from RGB or HSB components, or from constant UIKit and AppKit colors.
For a dynamic color, like one you load from an Asset Catalog using init(_:
, or one you create from a dynamic UIKit or AppKit color, this property is nil
.
init(uiColor : UIColor)
init(nsColor : NSColor)
init(cgColor : CGColor)