[]
Iterable<IGradientStop>IGradientStop objects.Use this collection to access, add, and remove the gradient stops that define a gradient fill or line. Instances of this interface are typically obtained from APIs such as IFillFormat.getGradientStops().
IComment comment = worksheet.getRange("A1").addComment("Gradient fill");
comment.getShape().getFill().twoColorGradient(GradientStyle.Horizontal, 1);
IGradientStops gradientStops = comment.getShape().getFill().getGradientStops();
gradientStops.get(0).getColor().setRGB(Color.FromArgb(255, 0, 0));
gradientStops.get(1).getColor().setRGB(Color.FromArgb(0, 0, 255));
voiddelete(int index) get(int index) IGradientStop object at the specified index from this IGradientStops collection.intgetCount()IGradientStops collection.voidinsert(int rgb,
double position) voidinsert(int rgb,
double position,
double transparency,
int index,
double brightness) forEach, iterator, spliteratorIGradientStops collection.Each gradient stop defines a color transition point in a gradient fill or line.
IShape shape = worksheet.getShapes().addShape(AutoShapeType.Rectangle, 20, 20, 120, 80);
IFillFormat fill = shape.getFill();
fill.twoColorGradient(GradientStyle.Horizontal, 1);
IGradientStops stops = fill.getGradientStops();
int count = stops.getCount();
IGradientStop objects in this collection.IGradientStop object at the specified index from this IGradientStops collection.
IShape shape = worksheet.getShapes().addShape(AutoShapeType.Rectangle, 20, 20, 120, 80);
IFillFormat fill = shape.getFill();
fill.twoColorGradient(GradientStyle.Horizontal, 1);
IGradientStops stops = fill.getGradientStops();
IGradientStop stop = stops.get(0);
double position = stop.getPosition();
index - The zero-based index of the gradient stop to retrieve.IGradientStop object at the specified index.Use this method to remove a color transition point from the gradient definition.
IShape shape = worksheet.getShapes().addShape(AutoShapeType.Rectangle, 20, 20, 120, 80);
IFillFormat fill = shape.getFill();
fill.twoColorGradient(GradientStyle.Horizontal, 1);
IGradientStops stops = fill.getGradientStops();
stops.delete(0);
index - The zero-based index of the gradient stop to remove.This overload forwards to insert(int,double,double,int,double) with transparency set to 0, index set to -1, and brightness set to 0.
IShape shape = worksheet.getShapes().addShape(AutoShapeType.Rectangle, 20, 20, 120, 80);
IFillFormat fill = shape.getFill();
fill.twoColorGradient(GradientStyle.Horizontal, 1);
IGradientStops stops = fill.getGradientStops();
stops.insert(Color.GetBlue().toArgb(), 0.5);
rgb - The color at the gradient stop, specified as an ARGB color value.position - The position of the stop within the gradient, expressed as a percentage.Use this method to add a stop to an existing gradient definition and control how the color appears at a specific point in the gradient.
IShape shape = worksheet.getShapes().addShape(AutoShapeType.Rectangle, 20, 20, 120, 80);
IFillFormat fill = shape.getFill();
fill.twoColorGradient(GradientStyle.Horizontal, 1);
IGradientStops stops = fill.getGradientStops();
stops.insert(Color.GetBlue().toArgb(), 0.5, 0.2, 1, 0.1);
rgb - The color of the gradient stop.position - The position of the stop within the gradient, expressed as a percentage.transparency - The opacity of the color at the gradient stop.index - The zero-based index at which to insert the gradient stop.brightness - The brightness of the color at the gradient stop.