<!--
{
  "availability" : [
    "macOS: -"
  ],
  "documentType" : "symbol",
  "framework" : "AppKit",
  "identifier" : "/documentation/AppKit/NSColorPickingDefault/attachColorList(_:)",
  "metadataVersion" : "0.1.0",
  "role" : "Instance Method",
  "symbol" : {
    "kind" : "Instance Method",
    "modules" : [
      "AppKit"
    ],
    "preciseIdentifier" : "c:objc(pl)NSColorPickingDefault(im)attachColorList:"
  },
  "title" : "attachColorList(_:)"
}
-->

# attachColorList(_:)

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

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

## Parameters

`colorList`

The color list to display.

## Discussion

You never invoke this method; it’s invoked automatically by the `NSColorPanel` object when its [`attachColorList(_:)`](/documentation/AppKit/NSColorPanel/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.

---

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)