The Color_GetFromDialog() function opens a color selection dialog that allows the user to pick a color.
Color_GetFromDialog(color_value {,color_mode}{,custom_colors[]})
• color_value – A long integer field or variable containing a color value. If you supply an initial value for this parameter, that color will be the default selection in the color selection dialog. If the user clicks OK in the color selection dialog, the color value selected will be returned. If the user clicks Cancel, the value -1 will be returned.
• color_mode – This optional parameter specifies what type of color will be returned. Use one of the following constants:
Constant |
Description |
---|---|
COLOR_MODE_EXACT |
The exact color the user selected is returned from the color selection dialog. |
COLOR_MODE_SOLID |
Only solid colors can be selected and returned from the color selection dialog, |
If you don’t supply this parameter, an exact color will be returned from the color selection dialog.
• custom_colors[] – An optional array of 16 long integer color values used to define the custom colors that appear in the Custom colors section of the color selection dialog. If you supply initial values for each of these array elements, those colors will appear in the color selection dialog. When the color selection dialog is closed, the custom color values defined in the dialog will be returned to this array. If you don’t supply this parameter, the 16 colors in the Custom colors section of the color selection dialog will be white.
A boolean indicating which buttons was clicked. True is indicates that OK was clicked, while false indiates that Cancel was clicked.
You can use the following constants when specifying solid colors:
Constant |
Constant |
---|---|
COLOR_BLACK |
COLOR_GREEN |
COLOR_WHITE |
COLOR_DARK_YELLOW |
COLOR_RED |
COLOR_VIOLET |
COLOR_BRIGHT_GREEN |
COLOR_DARK_RED |
COLOR_BLUE |
COLOR_DARK_BLUE |
COLOR_TURQUOISE |
COLOR_MEDIUM_GRAY |
COLOR_PINK |
COLOR_LIGHT_GRAY |
COLOR_YELLOW |
COLOR_LIGHT_YELLOW |
COLOR_TEAL |
|