---
title: "attachColorList(_:)"
framework: appkit
role: symbol
role_heading: Instance Method
path: "appkit/nscolorpickingdefault/attachcolorlist(_:)"
---

# attachColorList(_:)

Tells the receiver to attach the given color list, if it isn’t already displaying the list.

## Declaration

```swift
@MainActor func attachColorList(_ colorList: NSColorList)
```

## Parameters

- `colorList`: The color list to display.

## Discussion

Discussion You never invoke this method; it’s invoked automatically by the NSColorPanel object when its attachColorList(_:) method is invoked. Because the NSColorPanel list mode manages NSColorList objects, this method need only be implemented by a custom color picker that manages NSColorList objects itself.

## See Also

### Managing Color Lists

- [detachColorList(_:)](appkit/nscolorpickingdefault/detachcolorlist(_:).md)
