init(catalogName:colorName:)
Creates a color object using the specified asset catalog and color names.
Declaration
init?(catalogName listName: NSColorList.Name, colorName: NSColor.Name)Parameters
- listName:
The name of the asset catalog in which to find the specified color; this may be a standard color catalog.
- colorName:
The name of the color. Note that the color must be defined in the named color space to retrieve it with this method.
Return Value
The color object.
Discussion
This method searches the app’s main bundle for an asset catalog with the specified name. It then creates a color object based on the asset whose name matches the value in colorName.