Linear Brush (PRIM_VS.LinearBrush)

Gradient colors following a simple line

Ancestors - Gradient Brush (PRIM_VS.GradientBrush) Brush (PRIM_VS.Brush) Object (PRIM_OBJT)

Details

A Linear Brush is used to create a gradient color that transitions between the colors specified in the Colors property.
 
Linear brush has start and end coordinates to create an imaginary line that defines the path the gradient will follow, allowing the gradient to be vertical, horizontal or on an angle.

Example

The sample below changes from red at the start to blue at the end. This is denoted by the use of At(100) on the second color (#BrushColor2).
 
As the transition is uniform the red channel is decremented from 255 to 0 while the blue channel increases from 0 to 255. The result is that at the mid-point the color will be 128:0:128, which is purple.
 
The IDE will manage the creation of styles and brushes. This code is provided for reference purposes.
Begin_Com Role(*EXTENDS #PRIM_WEB) Height(457) Width(1169) Style(#Style1)
 
   Define_Com Class(#PRIM_VS.Style) Name(#Style1) Backgroundbrush(#LinearBrush1)
   Define_Com Class(#PRIM_VS.LinearBrush) Name(#LinearBrush1) Colors(#BrushColors1) Endtop(0) Endleft(100)
   Define_Com Class(#PRIM_VS.BrushColors) Name(#BrushColors1)
   Define_Com Class(#PRIM_VS.BrushColor) Name(#BrushColor1) Color(255:0:0) Parent(#BrushColors1)
   Define_Com Class(#PRIM_VS.BrushColor) Name(#BrushColor2) At(100) Color(0:0:255) Parent(#BrushColors1)
 
End_Com

Properties

NameDescription
ColorsCollection of colors to define the gradient Inherited from Gradient Brush (PRIM_VS.GradientBrush)
ComponentClassNameComponentClassName is the name of the component's class. Inherited from Object (PRIM_OBJT)
ComponentMembersComponentMembers provides access to all the member components of this component Inherited from Object (PRIM_OBJT)
ComponentPatternNameComponentPatternName is used to qualify the class of the component. Inherited from Object (PRIM_OBJT)
ComponentTagGeneric space allowing a value to be stored for the instance Inherited from Object (PRIM_OBJT)
ComponentTypeComponentType gives you access to the type information about the component Inherited from Object (PRIM_OBJT)
ComponentTypeNameComponentTypeName is the fully qualified name of the component's class. Inherited from Object (PRIM_OBJT)
EndLeftOne of four coordinates used to define the axis and extent of the brush
EndTopOne of four coordinates used to define the axis and extent of the brush
NameName identifies the component Inherited from Object (PRIM_OBJT)
OpacityOpacity to be applied to the brush Inherited from Gradient Brush (PRIM_VS.GradientBrush)
OwnerOwner owns this component Inherited from Object (PRIM_OBJT)
ParentThe component instance to which this instance is attached. The visual container for a control or the collector of a set of child instances Inherited from Object (PRIM_OBJT)
SpreadDefines brush behavior outside the bounds of the specified color range Inherited from Gradient Brush (PRIM_VS.GradientBrush)
StartLeftOne of four coordinates used to define the axis and extent of the brush
StartTopOne of four coordinates used to define the axis and extent of the brush

Events

NameDescription
CreateInstanceCreateInstance is signalled when an instance of a component is created Inherited from Linear Brush (PRIM_VS.LinearBrush)
DestroyInstanceDestroyInstance is signalled when an instance of a component is about to be destroyed Inherited from Linear Brush (PRIM_VS.LinearBrush)

See also

All Component Classes

Technical Reference

LANSA Version 15, April 2020