---
title: "setColorStoreAction(_:index:)"
framework: metal
role: symbol
role_heading: Instance Method
path: "metal/mtl4rendercommandencoder/setcolorstoreaction(_:index:)"
---

# setColorStoreAction(_:index:)

Configures the store action for a color attachment.

## Declaration

```swift
func setColorStoreAction(_ storeAction: MTLStoreAction, index colorAttachmentIndex: Int)
```

## Parameters

- `storeAction`: A store action for the color attachment that can’t be doc://com.apple.metal/documentation/Metal/MTLStoreAction/unknown.
- `colorAttachmentIndex`: The index of a color attachment.

## See Also

### Configuring the actions for attachments

- [setDepthStoreAction(_:)](metal/mtl4rendercommandencoder/setdepthstoreaction(_:).md)
- [setStencilStoreAction(_:)](metal/mtl4rendercommandencoder/setstencilstoreaction(_:).md)
