---
title: "insertNewButtonImage(_:in:)"
framework: appkit
role: symbol
role_heading: Instance Method
path: "appkit/nscolorpicker/insertnewbuttonimage(_:in:)"
---

# insertNewButtonImage(_:in:)

Sets the image used for the specified button cell.

## Declaration

```swift
@MainActor func insertNewButtonImage(_ newButtonImage: NSImage, in buttonCell: NSButtonCell)
```

## Parameters

- `newButtonImage`: The image used for the specified button cell.
- `buttonCell`: The button cell for which to set the image.

## Discussion

Discussion Called by the color panel to insert a new image into the specified cell by invoking NSButtonCell’s setImage: method. Override this method to customize newButtonImage before insertion in buttonCell.

## See Also

### Adding Button Images

- [provideNewButtonImage](appkit/nscolorpicker/providenewbuttonimage.md)
