<!--
{
  "availability" : [
    "iOS: 2.0.0 -",
    "iPadOS: 2.0.0 -",
    "macCatalyst: 13.1.0 -",
    "macOS: 10.3.0 -",
    "tvOS: -",
    "visionOS: 1.0.0 -",
    "watchOS: 2.0.0 -"
  ],
  "documentType" : "symbol",
  "framework" : "CoreGraphics",
  "identifier" : "/documentation/CoreGraphics/CGColorEqualToColor",
  "metadataVersion" : "0.1.0",
  "role" : "Function",
  "symbol" : {
    "kind" : "Function",
    "modules" : [
      "Core Graphics"
    ],
    "preciseIdentifier" : "c:@F@CGColorEqualToColor"
  },
  "title" : "CGColorEqualToColor"
}
-->

# CGColorEqualToColor

Indicates whether two colors are equal.

```
extern bool CGColorEqualToColor(CGColorRef color1, CGColorRef color2);
```

## Parameters

`color1`

The first color to compare.

`color2`

The second color to compare.

## Return Value

A Boolean value that, if <doc://com.apple.documentation/documentation/Swift/true>, indicates that the specified colors are equal. If the colors are not equal, the value is <doc://com.apple.documentation/documentation/Swift/false>.

## Discussion

Two colors are equal if they share the same color space and numerically equal color components.

---

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)