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 5 - Color Manager Reference /
Color Manager Functions / Application-Defined Functions


MySearchProc

Application-defined function that examines the RGBColor data structure passed by the Color Manager and returns the index to the best-mapping color in the current GDevice data structure.

By creating a custom search function, your application can override the Color Manager's code for inverse table mapping.

pascal Boolean MySearchProc (
RGBColor *rgb, 
long *position);
rgb
A pointer to a color value data structure.
position
A pointer to a color index value. On output, the index of the best-mapping color your function finds.
DISCUSSION
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 can't 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.


Previous Book Contents Book Index Next

© Apple Computer, Inc.
11 NOV 1996