Important: The information in this document is obsolete and should not be used for new development.
The Color Union
Your application can use a union of typeCMColorto 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
CWMatchColorsfunction (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
CWCheckColorsfunction (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
CMColorspecifying lists of colors to convert from one color space to another.
The color union is defined by the
- IMPORTANT
- You do not use a union of type
CMColorto convert colors expressed in the XYZ color space as values of typeCMFixedXYZbecause theCMColorunion does not support theCMFixedXYZdata type.![]()
CMColortype 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 theCMRGBColordata 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 theCMHSVColordata 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 theCMHLSColordata 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 theCMXYZColordata 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 theCMLabColordata 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 theCMLuvColordata 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 theCMYxyColordata 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 theCMCMYKColordata 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 theCMCMYColordata 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 theCMGrayColordata 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 theCMMultichannel5Colordata 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 theCMMultichannel6Colordata 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 theCMMultichannel7Colordata 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 theCMMultichannel8Colordata 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.