BACKCOLOR keyword

Applies To

Forms and components that support background colors.

Property defaults.

Properties: Data type and format.

Description

Specifies the background color on which the data for a form or component displays. The "color" can be either:

  • A single, solid color, with or without transparency
  • A pair of colors used for a linear gradient, with each color having its own independent color and transparency settings

Syntax

One of these:

  • BACKCOLOR( r, g, b )
  • BACKCOLOR( TYPE=0; ARGB=[ a, r, g, b ]; )
  • BACKCOLOR( TYPE=1; ARGB0=[ a, r, g, b ]; ARGB1=[ a, r, g, b ]; DIRECTION=dir#; )
  • BACKCOLOR( V(bgc_Form)
  • BACKCOLOR( V(bgc_componentName )
  • BACKCOLOR( V(gbgc_colorDefName )
Part Description
r, g, b Three integers in the range 0 to 255, representing the red, green, and blue values to use.
a, r, g, b Four integers in the range 0 to 255, representing the alpha, red, green, and blue values to use. (Alpha values control transparency of the color, with 0 being totally transparent and 255 being totally opaque.)
TYPE=# If TYPE equals:
  • 0, the form or object is to use a single solid color, and transparency (alpha) is supported.
  • 1 , the form or object is to apply a linear gradient with up to two colors (a starting color and an ending color).
ARGB#=... ARGB0 indicates the starting color in a gradient pair.

ARGB1 indicates the ending color in a gradient pair.

dir# Integer in the range 0 to 7. The default is 1.

 This value controls the direction in which a gradient is painted. For details, see the Remarks section.

V(bgc_Form)

V(bgc_componentName)

Indicates a reference to a form or global object variable that has a value in the BACKCOLOR keyword format. The reference to componentName represents the name of the component to which the background color settings are to be applied. When the variable value is being applied to the form background, the first format is used.

These variables are defined using the form or component property sheet in Design Mode.

V(gbgc_colorDefName) Indicates a reference to a color definition variable that has a value in the BACKCOLOR keyword format. colorDefName represents the name of a color definition variable, as defined, saved, and displayed in the Edit Color dialog box.

Remarks

  • The BACKCOLOR keyword is a parameter of the DEFAULTFORMAT keyword in a data type specification. The keyword also serves as an attribute of the format property of a component.
  • For the DIRECTION setting, you can use these settings (where yellow is the starting color [ARGB0] and green is the ending color [ARGB1]):
    0 Top-left to bottom-right
    1 Down (top to bottom)
    2 Top-right to bottom-left
    3 Right (left to right)
    4 Left (right to left)
    5 Bottom-left to top-right
    6 Up (bottom to top)
    7 Bottom-right to top-left

Examples

BACKCOLOR(0,0,0)
BACKCOLOR( 
 TYPE=1; ARGB0=[255, 210, 239, 109]; ARGB1=[128, 255, 255, 255]; DIRECTION=1; 
 )
BACKCOLOR( 
 V(gbgc_SampleColor1) )
相关主题