<!--
{
  "availability" : [
    "iOS: 2.0.0 -",
    "iPadOS: 2.0.0 -",
    "macCatalyst: 13.1.0 -",
    "tvOS: -",
    "visionOS: 1.0.0 -",
    "watchOS: 2.0.0 -"
  ],
  "documentType" : "symbol",
  "framework" : "UIKit",
  "identifier" : "/documentation/UIKit/UIColor/init(cgColor:)-27r9g",
  "metadataVersion" : "0.1.0",
  "role" : "Initializer",
  "symbol" : {
    "kind" : "Initializer",
    "modules" : [
      "UIKit"
    ],
    "preciseIdentifier" : "c:objc(cs)UIColor(im)initWithCGColor:"
  },
  "title" : "init(cgColor:)"
}
-->

# init(cgColor:)

Creates a color object using the specified Quartz color reference.

```
init(cgColor: CGColor)
```

## Parameters

`cgColor`

A reference to a Quartz color.

## Return Value

An initialized color object. The color information represented by this object is in the native colorspace of the specified Quartz color.

## See Also

[`+ (UIColor *) colorWithCGColor:(CGColorRef) cgColor;`](/documentation/UIKit/UIColor/colorWithCGColor:)

Creates a color object using the specified Quartz color reference.



---

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)