Advanced - Setting Colors and Shapes

In advanced code there are three functions that set the colors and shapes of the resulting paintbar.

 

SetColor, SetShape and SetColorAndShape

 

there is also a function GetNamedColor which allows you to get the color that is assigned by the user to a color name.

 

The following overloads of these functions are available:

 

SetColor(Color color)

 

SetColor(SysColor syscolor)

 

SetColor(int intcolorRGB)

Sets the output color to this absolute color. Does not allow the user of the paintbar to change the color in the paintbar instance parameters.

 

The SysColor refers to the MT's chart color scheme colors. intcolorRGB is the standard RGB representation of colors. For example, Color.Red is same as 0xFF0000.

SetColor(String NamedColor, SysColor DefaultColor = SysColor.None)

 

SetColor(String NamedColor, Color DefaultColor = default(Color))

 

SetColor(String NamedColor, uint DefaultColorRGB = 0)

Sets the output color to a "named color".  The name of the color will appear in the paintbar's instance parameters and user of the paintbar will be able to set it.

 

NOTE: The NamedColor has to be a literal string (not a variable) at least once in the code of the paintbar in order to appear in the paintbar's instance parameters.

SetShape(PBShape Shape)

Simply - set the shape. Set it to PBShape.Default to allow the user of the paintbar to set the desired shape in the paintbar's instance parameters.

SetColorAndShape...

Like SetColor, but also sets the shape.