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 2 - Color Picker Manager Reference /
Constants and Data Types


Picker Color Structure

For defining colors, version 2.0 of the Color Picker Manager uses a picker color structure. For example, when your application creates a color picker parameter block to pass to the PickColor function (page 2-35), your application supplies a picker color structure. The color that your application supplies in this field is passed to the color picker for editing. After the user clicks either the OK or Cancel button to close the dialog box, this field contains the color last chosen by the user.

The picker color structure includes a ColorSync 1.0 profile, a structure that matches colors among hardware devices such as displays, printers, and scanners. This color-matching profile (a data structure of type CMProfile) defines the color space of the color (which includes the type of color--RGB, CMYK, HSL, and so on). Using the dstProfile field of the color picker parameter block (page 2-20) or the SetPickerProfile function (page 2-50), your application can specify a destination color-matching profile, which describes the color space of the device for which the color is being chosen. Given information about the destination profile, color pickers that are ColorSync aware can help the user choose a color that's within the destination device's gamut.

IMPORTANT
This version of the Color Picker Manager uses ColorSync 1.0 profiles only. The ColorSync 1.0 profile is a handle-based profile. The profile format is defined by Apple Computer. You cannot use version 2.x profiles, which are identified by profile references, with this version of the Color Picker Manager. ColorSync 1.0 profiles typically reside in the ColorSyncTM Profiles folder (within the Preferences folder of the System Folder). They may also be embedded with the images to which they pertain in graphics files. The appendix "ColorSync Manager Backward Compatibility" in Advanced Color Imaging on the Mac OS provides information about the relationship between the ColorSync Manager version 2.x and ColorSync 1.0 profiles, which you may find useful.
The picker color structure is defined as follows:

typedef struct PMColor {
   CMProfileHandleprofile;
   CMColor        color;
} PMColor,*PMColorPtr;
Field Description
profile
A handle to a color-matching profile (CMProfile structure). If your application sets this field to nil, then the Color Picker Manager uses the default system profile.
color
A color, as specified in a color-matching (CMColor) structure, shown here.
               typedef union {
                RGBColorrgb;        /* an RGB color */
                XYZColorxyz;        /* an XYZ color */
                CMYKColorcmyk;      /* a CMYK color */
                unsigned short
                        reserved[4]; /* reserved */
               } CMColor, *CMColorList;

Previous Book Contents Book Index Next

© Apple Computer, Inc.
11 NOV 1996