Color Picker Module

Color Picker modules provide a plug-in interface for implementation of different color pickers in addition to the Photoshop and system color pickers. More...

Data Structures

struct  PickParms
 Structure used to return the color selected by the user. More...
struct  PIPickerParams
 This structure is passed to the plug-in module through the parameter block. More...

Typedefs

typedef struct PickParms PickParms
 Structure used to return the color selected by the user.
typedef struct PIPickerParams PIPickerParams
 This structure is passed to the plug-in module through the parameter block.
typedef struct PIPickerParamsPickerRecordPtr

Color Picker Module Selectors

#define pickerSelectorAbout   0
 Allows the plug-in to display an about dialog box.
#define pickerSelectorPick   1
 Allows the plug-in to execute the color picker.

Color Picker Error Return Values

#define pickerBadParameters   -30800
 A problem with the interface.

Detailed Description

Color Picker modules provide a plug-in interface for implementation of different color pickers in addition to the Photoshop and system color pickers.

They appear whenever the user requests a unique or custom color (such as clicking on the foreground or background colors in the tools palette) and are selected in the Preferences General dialog.

The file type for color picker modules for Mac OS is 8BCM, the extension for Windows is .8BC.

For additional information about writing color picker plug-ins, see Writing Color Picker Plug-ins.


Define Documentation

#define pickerSelectorAbout   0

Allows the plug-in to display an about dialog box.

For this selector, the host does not pass the standard parameter block into the plug-in main routine. Instead it passes an AboutRecord.

See About Boxes for more information.

#define pickerBadParameters   -30800

A problem with the interface.

#define pickerSelectorPick   1

Allows the plug-in to execute the color picker.

Unlike other plug-in modules, a Color Picker plug-in gets a single call from the host, and it is expected to do all the work during that call. However, it is recommended that it follow this order:

  1. Prompt for Parameters
    If the plug-in has any parameters that the user can set, it should prompt the user and save the values through the recording parameters for the scriptable handle accessed through the parameters structure. Photoshop initializes the parameters field to NULL when starting up.
    See Color Pickers and Scripting for more information about Scripting and Color Pickers.
  2. Allocate Memory
    Use the buffer and handle suites to allocate any extra memory needed for your computations. Please see Memory Management Strategies.
  3. Compute color space based on user input
    Compute whatever color conversions are required to return the user input to the host in the proper form.
  4. Clean up and hand back results
    Clean up after your operation. Dispose any handles you created, etc., then hand back your color to the host for use.


Typedef Documentation

typedef struct PickParms PickParms

Structure used to return the color selected by the user.

This structure is passed to the plug-in module through the parameter block.

See Plug-in Entry Point for an explanation of how the host calls a plug-in.

typedef struct PIPickerParams * PickerRecordPtr