PDefineColor

Defines a new color or tint and adds it to the Colors palette, or redefines an existing color.


Command constructors

This class has three constructors to create or modify:

Creating spot or process colors

You can create or modify spot or process colors in CMYK, RGB, or HLS color modes by specifying the three or four specific color values.

PDefineColor(const char * sColorName, eColorType cType, eColor cModel, PMBool bOverprint, short d1, short d2, short d3, short d4 = 0);

const char * sColorName;
Name of the new color or color being redefined (maximum of 31 characters). If redefining an existing color, the name must exactly match the name in the Colors palette.
short cType;
kColorTypeSpot for spot color
kColorTypeProcess for process color
short cModel;
kColorRGB for RGB color model, expressed in percentages
kColorCMYK for process color model
kColorHLS for HLS color model
kColorRGB255 for RGB color model, expressed in units from 0 to 255
PMBool bOverprint;
false to knockout objects of this color
true to overprint
short d1;
Percentage of red if cModel equals kColorRGB in tenths of a percent (100.0 = 1000)
Units of red if cModel equals kColorRGB255, from 0 to 255 in tenths of a unit (255.0 = 2550)
Percentage of cyan if cModel equals kColorCMYK in tenths of a percent (100.0 = 1000)
Degrees hue if cModel equals kColorHLS
short d2;
Percentage of green if cModel equals kColorRGB in tenths of a percent (100.0 = 1000)
Units of green if cModel equals kColorRGB255, from 0 to 255 in tenths of a unit (255.0 = 2550)
Percentage of magenta if cModel equals kColorCMYK in tenths of a percent (100.0 = 1000)
Percentage of lightness if cModel equals kColorHLS in tenths of a percent (100.0 = 1000)
short d3;
Percentage of blue if cModel equals kColorRGB in tenths of a percent (100.0 = 1000)
Units of blue if cModel equals kColorRGB255, from 0 to 255 in tenths of a unit (255.0 = 2550).
Percentage of yellow if cModel equals kColorCMYK in tenths of a percent (100.0 = 1000)
Percentage of saturation if cModel equals kColorHLS in tenths of a percent (100.0 = 1000)
short d4;
Percentage of black if cModel equals kColorCMYK in tenths of a percent (100.0 = 1000).
0 if cModel equals kColorRGB, kColorHLS, or kColorRGB255 (the default, you can omit this last parameter for these color types)

Creating high fidelity colors

The second constructor is used to create or modify hi-fidelity colors built with multiple hi-fi inks. You specify the names and percentages of one or more hi-fi inks to create the color.

PDefineColor(const char * sColorName, PMBool bOverprint, short cyan, short magenta, short yellow, short black, PRequestBuf& inks);

const char * sColorName;
Name of the new color or color being redefined (maximum of 31 characters). If redefining an existing color, the name must exactly match the name in the Colors palette.
PMBool bOverprint;
false to knockout objects of this color
true to overprint
short cyan;
Percentage of cyan in tenths of a percentage (100% = 1000)
short magenta;
Percentage of magenta in tenths of a percentage (100% = 1000)
short yellow;
Percentage of yellow in tenths of a percentage (100% = 1000)
short black;
Percentage of black in tenths of a percentage (100% = 1000)
PRequestBuf& inks
Create a PRequestBuf object, and then push the number of inks as a short, followed by that many pairs of:

const char * sInkName;

Name of ink
short dInkLevel;
Percentage of specified ink coverage value between 0.0 and 100.0 in tenths of a percent (100.0 = 1000).

Creating tint colors

The third constructor is used to create or modify tint colors (a color based on an existing color). You specify the base color name and the tint level for the new color.

PDefineColor(const char * sColorName, eColor cModel, PMBool bOverprint, short tintLevel, const char * sBaseColor);

const char * sColorName;
Name of the new color or color being redefined (maximum of 31 characters). If redefining an existing color, the name must exactly match the name in the Colors palette.
short cModel;
kColorRGB for RGB color model, expressed in percentages
kColorCMYK for process color model
kColorHLS for HLS color model
kColorRGB255 for RGB color model, expressed in units from 0 to 255
PMBool bOverprint;
false to knockout objects of this color
true to overprint
short tintLevel;
The tint level percentage from 0.0 to 100.0 in tenths of a percentage.
const char * sBaseName;
Name of the color on which this new tint color is being based.
Adding a color from a color library. To add a color from a color library to the Colors palette, use the PPickColor command.

Using an installable color picker. To use an installable color picker with PageMaker, use the PPickColor command.

HiFi colors. When you define a HiFi color, you must specify its CMYK values as well (which are used for composite printing).

Tints. You can base a tint only on an existing color in the Colors palette. To use a color in a color library, you must first add the color to the Colors palette; then define the tint.

You can base a tint on another tint as long as the logic isn't circular (for example, a slate green based on moss green which is, in turn, based on slate green creates a circular definition and is not allowed).

Color name restrictions. A color name cannot exceed 31 characters and, in English-language versions of PageMaker, cannot be: Process Cyan, Process Magenta, Process Yellow, Process Black, Black, black, Registration, or registration. In non-English language versions, PageMaker restricts the color names equivalent to those just mentioned.

Values truncated. Use whole percentages for d1, d2, d3, and d4; otherwise PageMaker will truncate the values.

Assigning color to text or graphics. Choose the PColor command when you want to assign a color to text or graphics. If you use PDefineColor and PColor together, put PDefineColor first.

Editing EPS colors. You cannot edit process colors imported with an EPS image. Attempts to edit EPS process colors will result in an error. You can, however, edit spot colors imported with an EPS image.

Example. The following example creates the color Rose based on a 35% tint of the color Pink.

PDefineColor("Rose", kColorCMYK, false, 350, "Pink");

The following example creates the process color Peach using the CMYK color model. Peach is composed of 15% cyan, 30% magenta, 10% yellow, and no black.

PDefineColor("Peach", kColorTypeProcess, kColorCMYK, false, 150, 300, 100, 0);


See also

The PGetColor, PGetColorInfo, and PGetColorNames queries

Adobe PageMaker 6.5 Help > Commands > Element > Define Colors


Copyright © 1996, Adobe Systems Incorporated. All rights reserved.

Comments or suggestions? Contact Adobe Developer Support