[]
        
(Showing Draft Content)

GrapeCity.Documents.Excel.Drawing.IGradientStops.Insert

Insert Method

Insert(int, double, double, int, double)

Adds a gradient stop with the specified color and position.

This overload forwards to Insert(int, double, double, int, double) with transparency set to 0, index set to -1, and brightness set to 0.

Declaration
void Insert(int rgb, double position, double transparency = 0, int index = -1, double brightness = 0)
Sub Insert(rgb As Integer, position As Double, Optional transparency As Double = 0, Optional index As Integer = -1, Optional brightness As Double = 0)
Parameters
Type Name Description
int rgb

The color at the gradient stop, specified as an ARGB color value.

double position

The position of the stop within the gradient, expressed as a percentage.

double transparency

The transparency of the gradient stop, where 0 is fully opaque and 1 is fully transparent.

int index

The zero-based index at which to insert the gradient stop. Use -1 to append the stop.

double brightness

The brightness adjustment for the gradient stop, from -1 to 1.

Examples
IShape shape = worksheet.Shapes.AddShape(AutoShapeType.Rectangle, 20, 20, 120, 80);
IFillFormat fill = shape.Fill;
fill.TwoColorGradient(GradientStyle.Horizontal, 1);
IGradientStops stops = fill.GradientStops;
stops.Insert(Color.Blue.ToArgb(), 0.5);