Freigeben über


GETCOLOR( ) Function

Displays the Windows Color dialog box and returns the color number of the chosen color.

GETCOLOR([nDefaultColorNumber])

Return Values

Numeric

Parameters

  • nDefaultColorNumber
    Specifies the color that is initially selected when the Color dialog box is displayed. If nDefaultColorNumber doesn't correspond to a color in the Color dialog box, the first color in the Color dialog box is selected. If you omit nDefaultColorNumber, black is selected.

Remarks

GETCOLOR( ) returns – 1 if you exit the Color dialog box by pressing ESC, choosing the Cancel button, or choosing Close from the Control menu.

Example

The following example displays the Windows Color dialog box with the color red selected. A number corresponding to the color you choose is displayed when you exit the dialog box.

CLEAR
? GETCOLOR(255)

See Also

GETPICT( ) | RGB( ) | GETCP( ) Function | Colors Overview