Class GradientColor
java.lang.Object
com.vaadin.flow.component.charts.model.style.GradientColor
- All Implemented Interfaces:
Color
,Serializable
Class providing gradient colors
- See Also:
-
Nested Class Summary
Modifier and TypeClassDescriptionstatic class
static class
static class
-
Method Summary
Modifier and TypeMethodDescriptionvoid
addColorStop
(double d, SolidColor color) Adds a color stop to the gradientstatic GradientColor
createLinear
(double startX, double startY, double endX, double endY) Creates a new linear gradient between two given points.static GradientColor
createRadial
(double centerX, double centerY, double radius) Creates a radial gradient color at a specified point with the given radius.getStops()
-
Method Details
-
getLinearGradient
- Returns:
- The linear gradient
-
getRadialGradient
- Returns:
- The radial gradient
-
getStops
- Returns:
- The stops of the gradient color
-
addColorStop
Adds a color stop to the gradient- Parameters:
d
- The relative point of the color stop, between 0 and 1color
- The color at the point defined by d
-
createLinear
Creates a new linear gradient between two given points. UseaddColorStop(double, SolidColor)
to define the colors.- Parameters:
startX
- The relative start point on the X-axis, 0..1startY
- The relative start point on the Y-axis, 0..1endX
- The relative end point on the X-axis, 0..1endY
- The relative end point on the Y-axis, 0..1- Returns:
- A new linear gradient color
-
createRadial
Creates a radial gradient color at a specified point with the given radius. UseaddColorStop(double, SolidColor)
to define the colors.- Parameters:
centerX
- The X coordinate of the centercenterY
- The Y coordinate of the centerradius
- The radius- Returns:
- A new radial gradient
-