Legacy Documentclose button

Important: The information in this document is obsolete and should not be used for new development.

Previous Book Contents Book Index Next

Inside Macintosh: Advanced Color Imaging Reference /
Chapter 3 - ColorSync Manager Reference for Applications and Device Drivers / Constants and Data Types


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:

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.

Previous Book Contents Book Index Next

© Apple Computer, Inc.
11 NOV 1996