---
title: "init(cgColor:)"
framework: uikit
role: symbol
role_heading: Initializer
path: "uikit/uicolor/init(cgcolor:)-27r9g"
---

# init(cgColor:)

Creates a color object using the specified Quartz color reference.

## Declaration

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

## Parameters

- `cgColor`: A reference to a Quartz color.

## Return Value

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

### Creating a color from another color object

- [init(_:)](uikit/uicolor/init(_:).md)
- [init(ciColor:)](uikit/uicolor/init(cicolor:)-2z057.md)
- [withAlphaComponent(_:)](uikit/uicolor/withalphacomponent(_:).md)
