---
title: "ColorSyncCreateCodeFragment(_:_:)"
framework: colorsync
role: symbol
role_heading: Function
platforms: [iOS 16.0+, iPadOS 16.0+, Mac Catalyst 13.0+, macOS 10.13+, tvOS 16.0+, visionOS 1.0+, watchOS 9.0+]
path: "colorsync/colorsynccreatecodefragment(_:_:)"
---

# ColorSyncCreateCodeFragment(_:_:)

Creates a code fragment from a sequence of profiles.

## Declaration

```swift
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

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

## Discussion

Discussion Each dictionary in profileSequence contains a profile object and information on the usage of the profile in the code fragment. Required keys: kColorSyncProfile: A ColorSyncProfile. kColorSyncRenderingIntent: A CFStringRef defining the rendering intent. kColorSyncTransformTag: A CFStringRef defining which tags to use. Optional key: kColorSyncBlackPointCompensation: A CFBooleanRef to enable or disable black point compensation. kColorSyncExtendedRange: A CFBooleanRef to enable or disable extended range; disabling implies floating point conversions.

## See Also

### Extracting a conversion for vImage

- [kColorSyncTransformCodeFragmentType](colorsync/kcolorsynctransformcodefragmenttype.md)
- [kColorSyncTransformCodeFragmentMD5](colorsync/kcolorsynctransformcodefragmentmd5.md)
