4D v14.3

Select RGB Color

Home

 
4D v14.3
Select RGB Color

Select RGB Color 


 

Select RGB Color {( defaultColor {; message} )} -> Function result 
Parameter Type   Description
defaultColor  Longint in Preselected RGB color
message  Alpha in Title of selection window
Function result  Longint in RGB color

The Select RGB Color command displays the system color selection window and returns the RGB value of the color selected by the user.

The system color selection window appears as follows:

MacintoshWindows
  

The optional defaultColor parameter preselects a color in the window. This parameter can be used, for example, to restore by default the last color set by the user. Pass an RGB-format color value in this parameter (for more information, refer to the description of the OBJECT SET RGB COLORS command). You can use one of the constants in the SET RGB COLORS theme. If the defaultColor parameter is omitted or if you pass 0, the color black is selected when the dialog box is opened.

The optional message parameter customizes the title of the system window. By default, if this parameter is omitted, the title “Colors” is displayed.

The effect of validating this dialog box differs depending on the platform:

  • Under Windows, when the user clicks on OK, the command returns the value of the color selected in RGB format and the system variable OK is set to 1. If the user cancels the dialog box, the command returns -1 and the system variable OK is set to 0.
  • Under Mac OS, you can only close this dialog box by clicking on the close box or by pressing on the Esc key. In both cases, the system variable OK is set to 1, regardless of the user actions in the window. The command returns the value of the color selected in RGB format. If the user did not select a color, the value returned is the one passed in defaultColor (if any) or 0 if defaultColor is not passed.

Note: This command must not be executed on the server machine nor within a Web process.

 
PROPERTIES 

Product: 4D
Theme: System Environment
Number: 956

The OK variable is changed by the commandNot for serverMac OS specific

 
HISTORY 

Created: 4D v11 SQL

 
SEE ALSO 

OBJECT SET RGB COLORS

 
ARTICLE USAGE

4D Language Reference ( 4D v11 SQL Release 6)
4D Language Reference ( 4D v12.4)
4D Language Reference ( 4D v14 R3)
4D Language Reference ( 4D v14 R2)
4D Language Reference ( 4D v13.5)
4D Language Reference ( 4D v14.3)
4D Language Reference ( 4D v14 R4)