---
title: "setTarget(_:)"
framework: appkit
role: symbol
role_heading: Instance Method
path: "appkit/nscolorpanel/settarget(_:)"
---

# setTarget(_:)

Sets the target of the receiver.

## Declaration

```swift
func setTarget(_ target: Any?)
```

## Parameters

- `target`: The target of the receiver. When you select a color in the color panel NSColorPanel sends its action to its target, provided that neither the action nor the target is nil. The target is nil by default.

## See Also

### Related Documentation

- [NSColorPanel](appkit/nscolorpanel.md)

### Configuring the color panel

- [accessoryView](appkit/nscolorpanel/accessoryview.md)
- [isContinuous](appkit/nscolorpanel/iscontinuous.md)
- [setAction(_:)](appkit/nscolorpanel/setaction(_:).md)
- [showsAlpha](appkit/nscolorpanel/showsalpha.md)
