<!--
{
  "availability" : [
    "macOS: -"
  ],
  "documentType" : "symbol",
  "framework" : "AppKit",
  "identifier" : "/documentation/AppKit/NSColor/init(catalogName:colorName:)",
  "metadataVersion" : "0.1.0",
  "role" : "Initializer",
  "symbol" : {
    "kind" : "Initializer",
    "modules" : [
      "AppKit"
    ],
    "preciseIdentifier" : "c:objc(cs)NSColor(cm)colorWithCatalogName:colorName:"
  },
  "title" : "init(catalogName:colorName:)"
}
-->

# init(catalogName:colorName:)

Creates a color object using the specified asset catalog and color names.

```
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`.

## See Also

[`catalogNameComponent`](/documentation/AppKit/NSColor/catalogNameComponent)

The catalog containing the color’s name.

[`localizedCatalogNameComponent`](/documentation/AppKit/NSColor/localizedCatalogNameComponent)

The localized version of the catalog name containing the color.

[`colorNameComponent`](/documentation/AppKit/NSColor/colorNameComponent)

The name of the color.



---

Copyright &copy; 2026 Apple Inc. All rights reserved. | [Terms of Use](https://www.apple.com/legal/internet-services/terms/site.html) | [Privacy Policy](https://www.apple.com/privacy/privacy-policy)