A set of components that define a color, with a color space specifying how to interpret them.
- iOS 2.0+
- macOS 10.3+
- Mac Catalyst 13.0+Beta
- tvOS 9.0+
- watchOS 2.0+
- Core Graphics
CGColor is the fundamental data type used internally by Core Graphics to represent colors.
CGColor objects, and the functions that operate on them, provide a fast and convenient way of managing and setting colors directly, especially colors that are reused (such as black for text).
A color object contains a set of components (such as red, green, and blue) that uniquely define a color, and a color space that specifies how those components should be interpreted.
Color objects provide a fast and convenient way to manage and set colors, especially colors that are used repeatedly. Drawing operations use color objects for setting fill and stroke colors, managing alpha, and setting color with a pattern.
CGColor is derived from
CFType and inherits the properties that all Core Foundation types have in common.