Function returns a numerical color value.  

Use this function in place a variable to the left so the function can assign the values it creates using the equal sign.  Function requires values in all three of its parameter fields.  Any and all values can be zero.  All values must be in the range of zero to 255.

 

More Color Information is available here: Color Selection Dialog

 

Syntax:

'  Create a color based upon the values of the three parameters
ColorValue = ColorRGB( BlueValue, GreenValue, RedValue

 

Parameter:

Description:

BlueValue
GreenValue
RedValue

All three parameter fields and their values can be any integer that begins at  0 and ends at 255.   Each value entered into each of these three parameters determines the color-number this function creates.  Number created is then the value needed to duplicate that color in a chart, or other process where a color value is needed.

 

Example:

'  Assign ColorRGB value to another variable  
'  Generate Red Color Number
ColorValue1 = ColorRGB( 255, 0, 0 )
'  Generate Green Color Number
ColorValue2 = ColorRGB( 0, 255, 0 )
'  Generate Blue C0lor Number
ColorValue3 = ColorRGB( 0, 0, 255 )

 

OR

'  Assign ColorRGB values to chart object function
'  Use Red Color value for data series Line1
chart.AddLineSeries( AsSeries( Line1 ), 100, "Line1", ColorRGB( 255, 0, 0 ) )
'  Use Green Color value for data series Line1
chart.AddLineSeries( AsSeries( Line2 ), 100, "Line2", ColorRGB( 0, 255, 0 ) )
'  Use Blue Color value for data series Line1
chart.AddLineSeries( AsSeries( Line3 ), 100, "Line3", ColorRGB( 0, 0, 255 ) )

 

OR

'  Assign ColorRGB values to SerSeriesColorStyle function
'  Use Red Color value for PlotLine1 series Line1
SetSeriesColorStyle( PlotLine1, ColorRGB( 255, 0, 0 ) )
'  Use Green Color value for PlotLine2 series Line1
SetSeriesColorStyle( PlotLine2, ColorRGB( 0, 255, 0 ) )
'  Use Blue Color value for PlotLine3 series Line1
SetSeriesColorStyle( PlotLine3, ColorRGB( 0, 0, 255 ) )

 

OR

'  Consider a Random number color assignment
'                         Red       GREEN          BLUE
plotColor = ColorRGB( Random(255), Random(255), Random(255) )

 

Returns:

Value returned is the RGB value that results from the combination of the three color values assigned.

 

Links:

AddLineSeries, Colors, Color Selection Dialog,   SetSeriesColorStyle

See Also:

 

 


Edit Time: 9/20/2020 11:37:21 AM


Topic ID#: 202

 

Created with Help & Manual 7 and styled with Premium Pack Version 2.80 © by EC Software