BCX_COLORDLG function

Purpose: BCX_COLORDLG creates a color dialog box that enables the user to select a color which is returned as a COLORREF value specifying an RGB color.


 Syntax:

 RetVal% = BCX_COLORDLG([DefaultColor][, hWndParent])

 Parameters:

  • RetVal% COLORREF value specifying an RGB color.
  • DefaultColor [OPTIONAL] The default COLORREF value to be set. If not set by the user the default is set to RGB(128,128,128).
  • hWndParent [OPTIONAL] Specifies the HWND type handle to the parent window if a modal dialog box is used.

Example:


 DIM RESULT$, i

 i = BCX_COLORDLG

 RESULT$ =           "RED   = " & STR$(GETRVALUE(i)) & CRLF$
 RESULT$ = RESULT$ & "GREEN = " & STR$(GETGVALUE(i)) & CRLF$
 RESULT$ = RESULT$ & "BLUE  = " & STR$(GETBVALUE(i)) & CRLF$

 MSGBOX RESULT$

GETRVALUE function

Purpose: GETRVALUE returns an integer containing the intensity value for the red component of a red, green, blue(RGB) value.


 Syntax:

 RetVal% = GETRVALUE(ColorRef%)

 Parameters:

  • RetVal% The value of the red component of the ColorRef% value.
  • ColorRef% The COLORREF value specifying an RGB color.

GETGVALUE function

Purpose: GETGVALUE returns an integer containing the intensity value for the green component of a red, green, blue(RGB) value.


 Syntax:

 RetVal% = GETGVALUE(ColorRef%)

 Parameters:

  • RetVal% The value of the green component of the ColorRef% value.
  • ColorRef% The COLORREF value specifying an RGB color.

GETBVALUE function

Purpose: GETBVALUE returns an integer containing the intensity value for the blue component of a red, green, blue(RGB) value.


 Syntax:

 RetVal% = GETBVALUE(ColorRef%)

 Parameters:

  • RetVal% The value of the blue component of the ColorRef% value.
  • ColorRef% The COLORREF value specifying an RGB color.

RGB function

Purpose: The RGB function returns a COLORREF value calculated from the red, green and blue arguments passed to the function.


 Syntax:

 RetVal% = RGB(red%, green%, blue%)

 Parameters:

  • RetVal% A COLORREF value in the range 0 to 16777215. COLORREF value has the following hexadecimal form:
    
     0x00bbggrr
    
    
  • red% An integer in the range 0 to 255 specifying the intensity of the red color.
  • green% An integer in the range 0 to 255 specifying the intensity of the green color.
  • blue% An integer in the range 0 to 255 specifying the intensity of the blue color.