[]
        
(Showing Draft Content)

GrapeCity.Documents.Excel.IColorStops.Add

Add Method

Add(double)

Adds a gradient stop at the specified relative position and returns the new IColorStop object.

The position value must be between 0.0 and 1.0, where 0.0 represents the start of the gradient and 1.0 represents the end.

Declaration
IColorStop Add(double position)
Function Add(position As Double) As IColorStop
Parameters
Type Name Description
double position

The relative position of the gradient stop, from 0.0 to 1.0.

Returns
Type Description
IColorStop

The new IColorStop object.

Examples
IRange range = worksheet.Range["A1"];
range.Interior.Pattern = Pattern.LinearGradient;

ILinearGradient gradient = (ILinearGradient) range.Interior.Gradient;
IColorStops colorStops = gradient.ColorStops;

colorStops[0].Color = Color.Red;
colorStops[1].Color = Color.Blue;

IColorStop middleStop = colorStops.Add(0.5);
middleStop.Color = Color.Yellow;