---
title: "setColor(_:atX:y:)"
framework: appkit
role: symbol
role_heading: Instance Method
path: "appkit/nsbitmapimagerep/setcolor(_:atx:y:)"
---

# setColor(_:atX:y:)

Changes the color of the pixel at the specified coordinates.

## Declaration

```swift
func setColor(_ color: NSColor, atX x: Int, y: Int)
```

## Parameters

- `color`: A color object representing the color to be set.
- `x`: The x-axis coordinate of the pixel.
- `y`: The y-axis coordinate of the pixel.

## See Also

### Managing Pixel Values

- [colorAt(x:y:)](appkit/nsbitmapimagerep/colorat(x:y:).md)
- [setPixel(_:atX:y:)](appkit/nsbitmapimagerep/setpixel(_:atx:y:).md)
- [getPixel(_:atX:y:)](appkit/nsbitmapimagerep/getpixel(_:atx:y:).md)
