---
title: "init(catalogName:colorName:)"
framework: appkit
role: symbol
role_heading: Initializer
path: "appkit/nscolor/init(catalogname:colorname:)"
---

# init(catalogName:colorName:)

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

## Declaration

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

Return Value The color object.

## Discussion

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

### Related Documentation

- [catalogNameComponent](appkit/nscolor/catalognamecomponent.md)
- [localizedCatalogNameComponent](appkit/nscolor/localizedcatalognamecomponent.md)
- [colorNameComponent](appkit/nscolor/colornamecomponent.md)

### Loading color objects from asset catalogs

- [init(named:)](appkit/nscolor/init(named:).md)
- [init(named:bundle:)](appkit/nscolor/init(named:bundle:).md)
- [NSColor.Name](appkit/nscolor/name.md)
