<!--
{
  "availability" : [
    "iOS: 16.0.0 -",
    "iPadOS: 16.0.0 -",
    "macCatalyst: 13.0.0 -",
    "macOS: 10.13.0 -",
    "tvOS: 16.0.0 -",
    "visionOS: 1.0.0 -",
    "watchOS: 9.0.0 -"
  ],
  "documentType" : "symbol",
  "framework" : "ColorSync",
  "identifier" : "/documentation/ColorSync/ColorSyncCreateCodeFragment(_:_:)",
  "metadataVersion" : "0.1.0",
  "role" : "Function",
  "symbol" : {
    "kind" : "Function",
    "modules" : [
      "ColorSync"
    ],
    "preciseIdentifier" : "c:@F@ColorSyncCreateCodeFragment"
  },
  "title" : "ColorSyncCreateCodeFragment(_:_:)"
}
-->

# ColorSyncCreateCodeFragment(_:_:)

Creates a code fragment from a sequence of profiles.

```
func ColorSyncCreateCodeFragment(_ profileSequence: CFArray!, _ options: CFDictionary!) -> Unmanaged<CFTypeRef>!
```

## Parameters

`profileSequence`

An array of dictionaries, each one containing a profile object and the information on the usage of the profile in the code fragment.

`options`

A dictionary with additional options as in the case of creating a `ColorSyncTransform`.

## Return Value

A `CFTypeRef` representing a ColorSync code fragment, or `NULL` in case of failure.

## Discussion

Each dictionary in `profileSequence` contains a profile object and information on the
usage of the profile in the code fragment.

Required keys:

- [`kColorSyncProfile`](/documentation/ColorSync/kColorSyncProfile): A [`ColorSyncProfile`](/documentation/ColorSync/ColorSyncProfile).
- [`kColorSyncRenderingIntent`](/documentation/ColorSync/kColorSyncRenderingIntent): A `CFStringRef` defining the rendering intent.
- [`kColorSyncTransformTag`](/documentation/ColorSync/kColorSyncTransformTag): A `CFStringRef` defining which tags to use.

Optional key:

- [`kColorSyncBlackPointCompensation`](/documentation/ColorSync/kColorSyncBlackPointCompensation): A `CFBooleanRef` to enable or disable black point compensation.
- [`kColorSyncExtendedRange`](/documentation/ColorSync/kColorSyncExtendedRange): A `CFBooleanRef` to enable or disable extended range; disabling implies floating point conversions.

---

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)