Carbon


GetColor

Header: ColorPicker.h Carbon status: Supported

Requests the user to choose a color. This function is obsolete; use the PickColor function instead.

Boolean GetColor (
    Point where, 
    ConstStr255Param prompt, 
    const RGBColor *inColor, 
    RGBColor *outColor
);
Parameter descriptions
where

A point defining the location of the upper-left corner of the dialog box. If you set this parameter to (0,0), the dialog box is centered horizontally on the main screen, with one-third of the empty space above the box and two-thirds below, regardless of the screen size. If you set this parameter to (–1,–1), the GetColor function displays the dialog box on the screen supporting the greatest pixel depth.

prompt

Text for prompting the user to choose a color. This string is displayed in the upper-left corner of the dialog box.

inColor

A pointer to an RGBColor structure for a color at entry to the picker. This is the original color, which the user may want for comparison.

outColor

A pointer to an RGBColor structure describing the new color. This is set to the last color that the user picked before clicking OK. On entry, the outColor parameter is treated as undefined, so the output color sample initially matches the input. Although the color being picked may vary widely, the input color sample remains fixed, and clicking the input sample resets the output color sample to match it.

function result

True if the user clicks the OK button; false if the user clicks the Cancel button. In either case, the dialog box is removed.

DISCUSSION

The GetColor function does not support ColorSync 1.0 color matching; however, the PickColor function does. This function was designed for use for version 1.0 of the Color Picker Package and is still supported for backward compatibility.

AVAILABILITY

Supported in Carbon. Available in Carbon 1.0.2 and later when running Mac OS 8.1 or later.


© 2000 Apple Computer, Inc. (Last Updated 6/30/2000)