![]() |
ColorSearchProcPtr |
||||
Header: | Quickdraw.h | Carbon status: | Supported | |
Defines a pointer to a color search callback function. Your color search callback function overrides the Color Managers code for inverse table mapping.
typedef Boolean(* ColorSearchProcPtr) ( RGBColor *rgb, SInt32 *position );
You would declare your function like this if you were to name it MyColorSearchCallback:
Boolean MyColorSearchCallback ( RGBColor *rgb, SInt32 *position );
A pointer to the RGBColor data structure passed to your search function. Your function should set the ColorSpec.value field to the index corresponding to the color indicated here.
A pointer to the index of the best-mapping color your function finds.
True if your function succeeds, false if your function cannot find a match.
Your MyColorSearchCallback function should examine the RGBColor data structure passed to it by the Color Manager and return the index to the best-mapping color in the current GDevice data structure.
The Color Manager specifies the desired color in the RGBColor field of a ColorSpec data structure and passes it by a pointer on the stack. Your function should return the corresponding index in the ColorSpec.value field. If your function cannot handle the search, return false as the function value, and pass the RGBColor data structure back to the Color Manager in the rgb parameter.
The Color Manager calls each search function in the list until one returns the Boolean value true. If no search function installed in the linked list returns true, the Color Manager calls the default search function.
© 2000 Apple Computer, Inc. (Last Updated 6/30/2000)