[]
A gradient stop defines one point in the gradient transition, including its color, position, and transparency. Use IFillFormat.getGradientStops() to access the stops in a gradient fill and adjust each IGradientStop to refine the gradient effect.
IShape shape = worksheet.getShapes().addShape(AutoShapeType.Rectangle, 50, 50, 120, 60);
shape.getFill().twoColorGradient(GradientStyle.Horizontal, 1);
IGradientStop gradientStop = shape.getFill().getGradientStops().get(0);
gradientStop.setPosition(0.25);
gradientStop.setTransparency(0.2);
getColor()doubledoublevoidsetPosition(double value) voidsetTransparency(double value) The returned IColorFormat object represents the color settings for this gradient stop and can be used to inspect or modify the stop color after a gradient is created with IFillFormat.twoColorGradient(GradientStyle,int).
IShape shape = worksheet.getShapes().addShape(AutoShapeType.Rectangle, 20, 20, 120, 80);
IFillFormat fill = shape.getFill();
fill.twoColorGradient(GradientStyle.Horizontal, 1);
IGradientStop stop = fill.getGradientStops().get(0);
IColorFormat color = stop.getColor();
color.setRGB(Color.GetRed());
IColorFormat object that represents the color of the gradient stop.The position determines where this stop is placed within the gradient definition.
IShape shape = worksheet.getShapes().addShape(AutoShapeType.Rectangle, 20, 20, 120, 80);
IFillFormat fill = shape.getFill();
fill.twoColorGradient(GradientStyle.Horizontal, 1);
IGradientStop stop = fill.getGradientStops().get(0);
double position = stop.getPosition();
The position determines where this stop is placed within the gradient definition.
IShape shape = worksheet.getShapes().addShape(AutoShapeType.Rectangle, 20, 20, 120, 80);
IFillFormat fill = shape.getFill();
fill.twoColorGradient(GradientStyle.Horizontal, 1);
IGradientStop stop = fill.getGradientStops().get(0);
stop.setPosition(100.0);
value - The position of the gradient stop.This value indicates the transparency setting applied at the current gradient stop.
IShape shape = worksheet.getShapes().addShape(AutoShapeType.Rectangle, 20, 20, 120, 80);
IFillFormat fill = shape.getFill();
fill.twoColorGradient(GradientStyle.Horizontal, 1);
IGradientStop stop = fill.getGradientStops().get(0);
double transparency = stop.getTransparency();
This value indicates the transparency setting applied at the current gradient stop.
IShape shape = worksheet.getShapes().addShape(AutoShapeType.Rectangle, 20, 20, 120, 80);
IFillFormat fill = shape.getFill();
fill.twoColorGradient(GradientStyle.Horizontal, 1);
IGradientStop stop = fill.getGradientStops().get(0);
stop.setTransparency(100.0);
value - The transparency value of the gradient stop, expressed as a percentage.