GradientStop Class
A gradient stop that defines a color and its position in a GradientFill.
Declaration
public class GradientStop extends OfficeObject
Remarks
The following code snippet creates gradient stops and adds them to a linear gradient fill:
import com.devexpress.docs.presentation.*;
import com.devexpress.docs.office.*;
import com.devexpress.system.drawing.*;
//...
// Build a gradient from orange to royal blue.
GradientFill fill = new GradientFill(GradientType.LINEAR);
fill.getGradientStops().add(new GradientStop(Color.getOrange(), 0.0f));
fill.getGradientStops().add(new GradientStop(Color.getRoyalBlue(), 100.0f));
shape.setFill(fill);
Inherited Members
Inheritance
Constructors
GradientStop(Color color, float position) Constructor
Initializes a new instance of the GradientStop class with specified settings.
Declaration
public GradientStop(Color color, float position)
Parameters
| Name | Type | Description |
|---|---|---|
| color | Color | Specifies the gradient stop color. |
| position | float | A value between |
GradientStop(OfficeColor color, float position) Constructor
Initializes a new instance of the GradientStop class with specified settings.
Declaration
public GradientStop(OfficeColor color, float position)
Parameters
| Name | Type | Description |
|---|---|---|
| color | OfficeColor | Specifies the gradient stop color. |
| position | float | A value between |
GradientStop(SchemeColors color, float position) Constructor
Initializes a new instance of the GradientStop class with specified settings.
Declaration
public GradientStop(SchemeColors color, float position)
Parameters
| Name | Type | Description |
|---|---|---|
| color | SchemeColors | Specifies the gradient stop color. |
| position | float | A value between |
GradientStop(SystemColors color, float position) Constructor
Initializes a new instance of the GradientStop class with specified settings.
Declaration
public GradientStop(SystemColors color, float position)
Parameters
| Name | Type | Description |
|---|---|---|
| color | SystemColors | Specifies the gradient stop color. |
| position | float | A value between |
Methods
getColor() Method
Returns gradient stop color.
Declaration
public OfficeColor getColor()
Returns
| Type | Description |
|---|---|
| OfficeColor | Gradient stop color. |
getPosition() Method
Returns the gradient stop position.
Declaration
public float getPosition()
Returns
| Type | Description |
|---|---|
| float | A value between 0 and 100 that specifies the gradient stop’s start position. |
setColor(OfficeColor value) Method
Sets gradient stop color.
Declaration
public void setColor(OfficeColor value)
Parameters
| Name | Type | Description |
|---|---|---|
| value | OfficeColor | Gradient stop color. |
setPosition(float value) Method
Sets the gradient stop position.
Declaration
public void setPosition(float value)
Parameters
| Name | Type | Description |
|---|---|---|
| value | float | A value between 0 and 100 that specifies the gradient stop’s start position. |