<!--
{
  "availability" : [
    "iOS: 13.0.0 -",
    "iPadOS: 13.0.0 -",
    "macCatalyst: 13.1.0 -",
    "macOS: 10.15.0 -",
    "tvOS: 13.0.0 -",
    "visionOS: 1.0.0 -",
    "watchOS: 6.0.0 -"
  ],
  "documentType" : "symbol",
  "framework" : "CoreGraphics",
  "identifier" : "/documentation/CoreGraphics/CGColor/init(genericGrayGamma2_2Gray:alpha:)",
  "metadataVersion" : "0.1.0",
  "role" : "Initializer",
  "symbol" : {
    "kind" : "Initializer",
    "modules" : [
      "Core Graphics",
      "CoreGraphics"
    ],
    "preciseIdentifier" : "c:@F@CGColorCreateGenericGrayGamma2_2"
  },
  "title" : "init(genericGrayGamma2_2Gray:alpha:)"
}
-->

# init(genericGrayGamma2_2Gray:alpha:)

Creates a color in the Generic gray color space with a gamma ramp of 2.2.

```
init(genericGrayGamma2_2Gray gray: CGFloat, alpha: CGFloat)
```

## Parameters

`gray`

A grayscale value (0.0 - 1.0).

`alpha`

An alpha value (0.0 - 1.0).

## Discussion

---

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)