chooseColor

Syntax

int chooseColor(int initialColor, string promptString, ...)

Arguments

initialColor
Specifies the initial or default color for the color picker, as an RGB triple.
promptString
Specifies the prompt string for the color picker. This string may contain printf-style format descriptors, which will be expanded using the succeeding arguments.
...
Variable number of arguments of varying types, should correspond to the format descriptors in promptString.

Return

The chosen color stored as an RGB triple, or -1 if the user cancels the color picker.

Description

chooseColor invokes the host application's default color picker dialog to allow the user to select an RGB color.

Example

int color = 0;

// Displays the color dialog with white as the default color
color = chooseColor( RGB ( 255,255,255 ), "Please choose a color:" );

// Display the RGB values of the chosen color
Info( "The following color was chosen: RGB (%d, %d, %d)", Rval( color ), Gval( color ), Bval( color ) );

Comments

Everyone can add his comments about his experiences with this function here. Tips for using it are welcome, too.