---
title: clearColor
framework: metal
role: symbol
role_heading: Instance Property
path: metal/mtlrenderpasscolorattachmentdescriptor/clearcolor
---

# clearColor

The color to use when clearing the color attachment.

## Declaration

```swift
var clearColor: MTLClearColor { get set }
```

## Discussion

Discussion If the loadAction property of the attachment is set to MTLLoadAction.clear, then at the start of a render pass, the GPU fills the texture with the value stored in the clearColor property. Otherwise, the GPU ignores the clearColor property. The clearColor property represents a set of RGBA components. The default value is (0.0, 0.0, 0.0, 1.0) (black). Use the MTLClearColorMake(_:_:_:_:) function to construct an MTLClearColor value.

## See Also

### Specifying clearing value

- [MTLClearColorMake(_:_:_:_:)](metal/mtlclearcolormake(_:_:_:_:).md)
