---
title: "removeColor(withKey:)"
framework: appkit
role: symbol
role_heading: Instance Method
path: "appkit/nscolorlist/removecolor(withkey:)"
---

# removeColor(withKey:)

Removes the color associated with the specified key from the color list.

## Declaration

```swift
func removeColor(withKey key: NSColor.Name)
```

## Parameters

- `key`: The key for which to remove the color.

## Discussion

Discussion This method does nothing if the receiver doesn’t contain the key. This method posts didChangeNotification to the default notification center. It raises NSColorListNotEditableException if the receiver is not editable.

## See Also

### Managing Colors By Key

- [allKeys](appkit/nscolorlist/allkeys.md)
- [color(withKey:)](appkit/nscolorlist/color(withkey:).md)
- [insertColor(_:key:at:)](appkit/nscolorlist/insertcolor(_:key:at:).md)
- [setColor(_:forKey:)](appkit/nscolorlist/setcolor(_:forkey:).md)
