<!--
{
  "availability" : [
    "iOS: 9.0.0 -",
    "iPadOS: 9.0.0 -",
    "macCatalyst: 13.1.0 -",
    "macOS: 10.11.0 -",
    "tvOS: 9.0.0 -",
    "visionOS: 1.0.0 -"
  ],
  "documentType" : "symbol",
  "framework" : "MetalKit",
  "identifier" : "/documentation/MetalKit/MTKView/clearColor",
  "metadataVersion" : "0.1.0",
  "role" : "Instance Property",
  "symbol" : {
    "kind" : "Instance Property",
    "modules" : [
      "MetalKit"
    ],
    "preciseIdentifier" : "c:objc(cs)MTKView(py)clearColor"
  },
  "title" : "clearColor"
}
-->

# clearColor

The color to use to clear the color target when creating a render pass descriptor.

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

## Discussion

When the view creates a render pass, it sets the load action for the color render target to <doc://com.apple.documentation/documentation/Metal/MTLLoadAction/clear> and uses this color as the clear color. The default value is `(0.0, 0.0, 0.0, 1.0)`.

---

Copyright &copy; 2026 Apple Inc. All rights reserved. | [Terms of Use](https://www.apple.com/legal/internet-services/terms/site.html) | [Privacy Policy](https://www.apple.com/privacy/privacy-policy)