---
title: CWMatchColors
framework: Application Services
role: pseudoSymbol
platforms: []
path: applicationservices/colorsync_manager/1805108-cwmatchcolors
---

# CWMatchColors

Matches colors in a color list, using the specified color world.

## Declaration

```occ
CMError CWMatchColors (
   CMWorldRef cw,
   CMColor *myColors,
   size_t count
);
```

## Parameters

- `cw`: A reference to the color world of type [doc://com.apple.documentation/documentation/applicationservices/cmworldref](applicationservices/cmworldref.md) that describes how matching is to occur in the color-matching session.
 The functions [doc://com.apple.documentation/documentation/applicationservices/colorsync_manager/1805079-ncwnewcolorworld](applicationservices/colorsync_manager/1805079-ncwnewcolorworld.md) and [doc://com.apple.documentation/documentation/applicationservices/colorsync_manager/1805087-cwconcatcolorworld](applicationservices/colorsync_manager/1805087-cwconcatcolorworld.md) both allocate color world references of type [doc://com.apple.documentation/documentation/applicationservices/cmworldref](applicationservices/cmworldref.md).
- `myColors`: A pointer to an array containing a list of colors of type [doc://com.apple.documentation/documentation/applicationservices/1560453-cmcolor](applicationservices/1560453-cmcolor.md). On input, contains the list of colors to match. On return, contains the list of matched colors specified in the color data space of the color world’s destination profile.
- `count`: A one-based count of the number of colors in the color list of the `myColors` array.

## Return Value

A `CMError` value. See [Result Codes](../colorsync_manager.md).

## Overview

The `CWMatchColors` function matches colors according to the profiles corresponding to the specified color world. On input, the color values in the `myColors` array are assumed to be specified in the data color space of the source profile. On return, the color values in the `myColors` array are transformed to the data color space of the destination profile.

All color management modules (CMM)s must support this function. 

This function supports color-matching sessions set up with one of the multichannel color data types. 

## See Also

### Working With ColorWorlds

- [NCWNewColorWorld](1805079-ncwnewcolorworld.md)
- [CWConcatColorWorld](1805087-cwconcatcolorworld.md)
- [NCWConcatColorWorld](1805091-ncwconcatcolorworld.md)
- [CMGetCWInfo](1805097-cmgetcwinfo.md)
- [CWDisposeColorWorld](1805102-cwdisposecolorworld.md)
- [CWCheckColors](1805111-cwcheckcolors.md)
- [CWMatchBitmap](1805116-cwmatchbitmap.md)
- [CWCheckBitmap](1805121-cwcheckbitmap.md)
- [CWFillLookupTexture](1805126-cwfilllookuptexture.md)
