---
title: cgColor
framework: uikit
role: symbol
role_heading: Instance Property
path: uikit/uicolor/cgcolor
---

# cgColor

The Quartz color that corresponds to the color object.

## Declaration

```swift
var cgColor: CGColor { get }
```

## Discussion

Discussion The color object in this property doesn’t adapt automatically to Dark Mode changes. If you use it to set the color of interface elements, you must update that color yourself. You update that color when the userInterfaceStyle trait of the current trait collection changes. For information on how to apply color information reliably, see Supporting Dark Mode in your interface.

## See Also

### Getting the color information

- [Determining color values with color spaces](uikit/determining-color-values-with-color-spaces.md)
- [ciColor](uikit/uicolor/cicolor.md)
- [getHue(_:saturation:brightness:alpha:)](uikit/uicolor/gethue(_:saturation:brightness:alpha:).md)
- [getRed(_:green:blue:alpha:)](uikit/uicolor/getred(_:green:blue:alpha:).md)
- [getWhite(_:alpha:)](uikit/uicolor/getwhite(_:alpha:).md)
- [linearExposure](uikit/uicolor/linearexposure.md)
- [accessibilityName](uikit/uicolor/accessibilityname.md)
