<!--
{
  "availability" : [
    "iOS: -",
    "iPadOS: -",
    "macCatalyst: -",
    "macOS: -",
    "tvOS: -",
    "visionOS: -"
  ],
  "documentType" : "symbol",
  "framework" : "Metal",
  "identifier" : "/documentation/Metal/MTLClearColor/init(red:green:blue:alpha:)",
  "metadataVersion" : "0.1.0",
  "role" : "Initializer",
  "symbol" : {
    "kind" : "Initializer",
    "modules" : [
      "Metal"
    ],
    "preciseIdentifier" : "s:So13MTLClearColora3red5green4blue5alphaABSd_S3dtcfc"
  },
  "title" : "init(red:green:blue:alpha:)"
}
-->

# init(red:green:blue:alpha:)

Returns a new color structure with the specified red, green, blue, and alpha values.

```
init(red: Double, green: Double, blue: Double, alpha: Double)
```

## Parameters

`red`

The red color channel.

`green`

The green color channel.

`blue`

The blue color channel.

`alpha`

The alpha channel.

---

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)