---
title: UIColor
framework: uikit
role: symbol
role_heading: Class
path: uikit/uicolor
---

# UIColor

An object that stores color data and sometimes opacity.

## Declaration

```swift
class UIColor
```

## Mentioned in

Customizing drawings Determining color values with color spaces Understanding a drag item as a promise

## Overview

Overview Use color to customize your app’s appearance, communicate status, and help people visualize data. To learn more about using color in your apps, see Human Interface Guidelines. UIColor provides a list of class properties that create adaptable and fixed colors such as blue, green, purple, and more. UIColor also offers properties to specify system-provided colors for UI elements such as labels, text, and buttons. You can create color objects by specifying color component values such as RGB, hue, and saturation. You can also create colors from other color objects and even create a pattern-based color from an image. important: Most developers have no need to subclass UIColor. The only time subclassing might be necessary is if you require support for additional color spaces or color models. If you do subclass, the properties and methods you add must be safe to use from multiple threads.

## Topics

### Getting existing colors

- [UI element colors](uikit/ui-element-colors.md)
- [Standard colors](uikit/standard-colors.md)
- [Color creation](uikit/color-creation.md)

### Applying the color to the drawing environment

- [Customizing drawings](uikit/customizing-drawings.md)
- [set()](uikit/uicolor/set().md)
- [setFill()](uikit/uicolor/setfill().md)
- [setStroke()](uikit/uicolor/setstroke().md)

### Getting the color information

- [Determining color values with color spaces](uikit/determining-color-values-with-color-spaces.md)
- [cgColor](uikit/uicolor/cgcolor.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)

### Resolving a dynamically generated color

- [resolvedColor(with:)](uikit/uicolor/resolvedcolor(with:).md)

### Working with color prominence

- [prominence](uikit/uicolor/prominence-swift.property.md)
- [withProminence(_:)](uikit/uicolor/withprominence(_:).md)
- [UIColor.Prominence](uikit/uicolor/prominence-swift.enum.md)

### Working with high dynamic range (HDR) colors

- [applyingContentHeadroom(_:)](uikit/uicolor/applyingcontentheadroom(_:).md)
- [standardDynamicRange](uikit/uicolor/standarddynamicrange.md)

### Initializers

- [init(CGColor:)](uikit/uicolor/init(cgcolor:)-58l83.md)
- [init(CGColor:)](uikit/uicolor/init(cgcolor:)-9d9vs.md)
- [init(CIColor:)](uikit/uicolor/init(cicolor:)-2b5ik.md)
- [init(CIColor:)](uikit/uicolor/init(cicolor:)-5fqhu.md)
- [init(coder:)](uikit/uicolor/init(coder:).md)
- [init(named:in:compatibleWith:)](uikit/uicolor/init(named:in:compatiblewith:).md)

### Default Implementations

- [UIColor Implementations](uikit/uicolor/uicolor-implementations.md)

## Relationships

### Inherits From

- [NSObject](objectivec/nsobject-swift.class.md)

### Conforms To

- [CVarArg](swift/cvararg.md)
- [Copyable](swift/copyable.md)
- [CustomDebugStringConvertible](swift/customdebugstringconvertible.md)
- [CustomStringConvertible](swift/customstringconvertible.md)
- [Equatable](swift/equatable.md)
- [Escapable](swift/escapable.md)
- [Hashable](swift/hashable.md)
- [NSCoding](foundation/nscoding.md)
- [NSCopying](foundation/nscopying.md)
- [NSItemProviderReading](foundation/nsitemproviderreading.md)
- [NSItemProviderWriting](foundation/nsitemproviderwriting.md)
- [NSObjectProtocol](objectivec/nsobjectprotocol.md)
- [NSSecureCoding](foundation/nssecurecoding.md)
- [Sendable](swift/sendable.md)
- [SendableMetatype](swift/sendablemetatype.md)
