The Color Union
Your application can use a union of type CMColor to specify a color value defined by one of the 15 data types supported by the union. Your application uses an array of color unions to specify a list of colors to match, check, or convert. The array is passed as a parameter to the low-level color-matching, color-checking, or color-conversion functions. The following functions use a color union:
- The
CWMatchColors function (page 3-125) matches the colors in the color list array to the data color space of the destination profile specified by the color world.
- The
CWCheckColors function (page 3-126) checks the colors in the color list array against the color gamut specified by the color world's destination profile.
- The color conversion functions (page 3-143 to 3-157) take source and destination array parameters of type
CMColor specifying lists of colors to convert from one color space to another.
- IMPORTANT
- You do not use a union of type
CMColor to convert colors expressed in the XYZ color space as values of type CMFixedXYZ because the CMColor union does not support the CMFixedXYZ data type.
The color union is defined by the CMColor type definition. Each of the color types included in the union is defined previously.
union CMColor {
CMRGBColor rgb;
CMHSVColor hsv;
CMHLSColor hls;
CMXYZColor XYZ;
CMLabColor Lab;
CMLuvColor Luv;
CMYxyColor Yxy;
CMCMYKColor cmyk;
CMCMYColor cmy;
CMGrayColor gray;
CMMultichannel5Color mc5;
CMMultichannel6Color mc6;
CMMultichannel7Color mc7;
CMMultichannel8Colormc8;
CMNamedColor namedColor;
};
A color union can contain one of the following fields:
Field Description
rgb
- A color value expressed in the RGB color space as data of type
CMRGBColor. See "RGB Color Value" (page 3-56) for a description of the CMRGBColor data type.
hsv
- A color value expressed in the HSV color space as data of type
CMHSVColor. See "HSV Color Value" (page 3-57) for a description of the CMHSVColor data type.
hls
- A color value expressed in the HLS color space as data of type
CMHLSColor. See "HLS Color Value" (page 3-56) for a description of the CMHLSColor data type.
XYZ
- A color value expressed in the XYZ color space as data of type
CMXYZColor. See "XYZ Color Value" (page 3-54) for a description of the CMXYZColor data type.
Lab
- A color value expressed in the L*a*b* color space as data of type
CMLabColor. See "L*a*b* Color Value" (page 3-55) for a description of the CMLabColor data type.
Luv
- A color value expressed in the L*u*v* color space as data of type
CMLuvColor. See "L*u*v* Color Value" (page 3-55) for a description of the CMLuvColor data type.
Yxy
- A color value expressed in the Yxy color space as data of type
CMYxyColor. See "Yxy Color Value" (page 3-56) for a description of the CMYxyColor data type.
cmyk
- A color value expressed in the CMYK color space as data of type
CMCMYKColor. See "CMYK Color Value" (page 3-57) for a description of the CMCMYKColor data type.
cmy
- A color value expressed in the CMY color space as data of type
CMCMYColor. See "CMY Color Value" (page 3-57) for a description of the CMCMYColor data type.
gray
- A color value expressed in the Gray color space as data of type
CMGrayColor. See "Gray Color Value" (page 3-58) for a description of the CMGrayColor data type.
mc5
- A color value expressed in the five-channel multichannel color space as data of type
CMMultichannel5Color. See "HiFi Color Values" (page 3-58) for a description of the CMMultichannel5Color data type.
mc6
- A color value expressed in the six-channel multichannel color space as data of type
CMMultichannel6Color. See "HiFi Color Values" (page 3-58) for a description of the CMMultichannel6Color data type.
mc7
- A color value expressed in the seven-channel multichannel color space as data of type
CMMultichannel7Color. See "HiFi Color Values" (page 3-58) for a description of the CMMultichannel7Color data type.
mc8
- A color value expressed in the eight-channel multichannel color space as data of type
CMMultichannel8Color. See "HiFi Color Values" (page 3-58) for a description of the CMMultichannel8Color data type.
namedColor
- A color value expressed as an index into a named color space. See "Named Color Value" (page 3-59) for a description of the CMNamedColor data type.