<!--
{
  "availability" : [
    "iOS: 9.0.0 -",
    "iPadOS: 9.0.0 -",
    "macCatalyst: 13.1.0 -",
    "macOS: 10.11.0 -",
    "tvOS: 9.0.0 -",
    "visionOS: 1.0.0 -",
    "watchOS: 2.0.0 -"
  ],
  "documentType" : "symbol",
  "framework" : "CoreGraphics",
  "identifier" : "/documentation/CoreGraphics/CGColor/converted(to:intent:options:)",
  "metadataVersion" : "0.1.0",
  "role" : "Instance Method",
  "symbol" : {
    "kind" : "Instance Method",
    "modules" : [
      "Core Graphics",
      "CoreGraphics"
    ],
    "preciseIdentifier" : "c:@F@CGColorCreateCopyByMatchingToColorSpace"
  },
  "title" : "converted(to:intent:options:)"
}
-->

# converted(to:intent:options:)

Creates a new color in a different color space that matches the provided color.

```
func converted(to _: CGColorSpace, intent: CGColorRenderingIntent, options: CFDictionary?) -> CGColor?
```

## Discussion

### Parameters

- CGColorSpaceRef: The destination color space.
- to: The destination color space.
- intent: The mechanism to use to match the color when the color is outside the gamut of the new color space.
- color: The color to convert.
- options: A dictionary of options used to convert the color. Currently, you should pass `NULL`.

### Returns

A new color in the destination color space that matches (or closely approximates) the source color.

## Discussion

To create the new color, this method creates a `CFColorConverterRef` using the options you specified and applies it to the source color.

---

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)