---
title: "init(name:fromFile:)"
framework: appkit
role: symbol
role_heading: Initializer
path: "appkit/nscolorlist/init(name:fromfile:)"
---

# init(name:fromFile:)

Initializes and returns a color list from the specified file, registering it under the specified name if it isn’t in use already.

## Declaration

```swift
init?(name: NSColorList.Name, fromFile path: String?)
```

## Parameters

- `name`: The name of the file for the color list (minus the “.clr” extension). Specify @”” if you don’t want a name.
- `path`: The full path to the file for the color list. A nil path indicates the color list should be initialized with no colors.

## Discussion

Discussion Note that this method does not add the color list to availableColorLists until the color list is saved into the user’s path with write(toFile:) with a value of nil.

## See Also

### Creating Lists of Colors

- [init(name:)](appkit/nscolorlist/init(name:).md)
