Important: The information in this document is obsolete and should not be used for new development.
MyGetColor
Color picker-defined subroutine that handles akGetColor
request.If you create a color picker, it must respond to the
kGetColor
request code. The Color Picker Manager sends this code to request your color picker to return an original or a new color. A color picker responds to thekGetColor
request code by calling a color picker-defined subroutine (for example,MyGetColor
) to handle the request.
pascal ComponentResult MyGetColor ( PickerStorageHndl storage, ColorType whichColor, PMColorPtr color);
storage
- A handle to your color picker's global data.
whichColor
- A type of color--either original or new--requested from your color picker. Your function should respond to the value represented by either the
kOriginalColor
orkNewColor
constant.color
- A pointer to a
PMColor
structure (page 2-15).DISCUSSION
In thePMColor
structure pointed to by thecolor
parameter, yourMyGetColor
function should return a color. If yourMyGetColor
function is passed the value represented by thekOriginalColor
constant, it should return the color that the user first begins to edit. If yourMyGetColor
function is passed the value represented by thekNewColor
constant, it should return the last color selected by the user.Your function should return
noErr
if successful, or an appropriate result code otherwise.SEE ALSO
Listing 2-24 in Advanced Color Imaging on the Mac OS illustrates how to implement this function.