Colors Overview
Color States
A color state is comprised of pen and brush settings. The brush is used for painting the enclosed areas
of shapes, while the pen is used for drawing the border of shapes. In the case of the line, polyline,
freehand, and spline shapes the brush is not used.
Brush settings include:
foreground color
The foreground color is the fill color. If the fill style pattern is something other than solid,
the foreground color is the color of the lines in the pattern.
background color
The background color is the fill color for the spaces between the style pattern. It only takes
affect when the mode is opaque, and style is set to something other than transparent or solid.
mode
The transparency of the brush (either transparent or opaque).
style
The pattern of the enclosed area of a shape.
Pen settings include:
foreground color
The foreground color is the color of the border around shapes.
style
The pattern of the pen. The color used to fill the spaces between the line patterns is the brush
background color.
width
The width of the pen in pixels.
Colors With Layers, Shapes, and Groups
When shapes are added to the Cad control, by default they use the color state of the Cad. Layers, groups
and shapes may have their own unique color state, however. This happens whenever any of the layer or shape
color properties is set (LayerPenFg,
LayerBrushFg,
LayerBrushBg, ShapePenFg,
ShapeBrushFg,
ShapeBrushBg).
Color Property Hierarchy
The precedence for which color state a shape uses is:
1. Shape color state (if shape has its own color state)
2. Group color state (if shape belongs in a group, and that group has its own color state)
3. Layer color state
4. Cad color state
As long as a shape has its own color state, it will ignore the group, layer and cad color properties.
Group color states will ignore layer and cad color proprties and so forth. To determine if a shape or
a group has its own color state, use ShapeIsColorSet.
To determine if a layer has its own color state, use LayerIsColorSet.
To reset the color state of the shape, group or layer (causing it to use the color state of next highest
level in the color hierarchy), use ShapeColorReset
or LayerColorReset.
Setting Colors
The value that each of the color properties takes is an OLE color value. How to set a color property,
and the value it returns, depends on the programming language used.
FoxPro uses RGB().
Visual Basic uses QBColor() or RGB().
MSVC uses RGB().
Delphi uses RGB().
For other programming languages, check your documentation.
See Also
Cad Color Properties: CadBrushFG,
CadBrushBg,
CadBrushMode,
CadBrushStyle,
CadBrushFg,
CadPenStyle,
CadPenWidth
Layer Color Properties: LayerBrushFg,
LayerBrushBg,
LayerBrushMode,
LayerBrushStyle,
LayerPenFg,
LayerPenStyle,
LayerPenWidth
Shape Color Properties: ShapeBrushFg,
ShapeBrushBg,
ShapeBrushMode,
ShapeBrushStyle,
ShapePenFg,
ShapePenStyle,
ShapePenWidth
Sticky Point Marker Color Properties: FlowFemaleStickyBrushBg,
FlowFemaleStickyBrushFg,
FlowFemaleStickyBrushStyle,
FlowFemaleStickyBrushMode,
FlowFemaleStickyPenFg,
FlowFemaleStickyPenStyle,
FlowFemaleStickyMarkerSize,
FlowMaleStickyBrushBg,
FlowMaleStickyBrushFg,
FlowMaleStickyBrushStyle,
FlowMaleStickyBrushMode,
FlowMaleStickyPenFg,
FlowMaleStickyPenStyle,
FlowMaleStickyMarkerSize
Other: ShapeIsColorSet,
ShapeColorReset,
GridColor,
BackColor
![]() |
Last modified on: Tuesday, February 04, 2003