Class GradientColor
- java.lang.Object
-
- com.vaadin.flow.component.charts.model.style.GradientColor
-
- All Implemented Interfaces:
Color
,Serializable
public class GradientColor extends Object implements Color
Class providing gradient colors- See Also:
- Serialized Form
-
-
Nested Class Summary
Nested Classes Modifier and Type Class Description static class
GradientColor.LinearGradient
static class
GradientColor.RadialGradient
static class
GradientColor.Stop
-
Method Summary
All Methods Static Methods Instance Methods Concrete Methods Modifier and Type Method Description void
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.GradientColor.LinearGradient
getLinearGradient()
GradientColor.RadialGradient
getRadialGradient()
List<GradientColor.Stop>
getStops()
-
-
-
Method Detail
-
getLinearGradient
public GradientColor.LinearGradient getLinearGradient()
- Returns:
- The linear gradient
-
getRadialGradient
public GradientColor.RadialGradient getRadialGradient()
- Returns:
- The radial gradient
-
getStops
public List<GradientColor.Stop> getStops()
- Returns:
- The stops of the gradient color
-
addColorStop
public void addColorStop(double d, SolidColor color)
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
public static GradientColor createLinear(double startX, double startY, double endX, double endY)
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
public static GradientColor createRadial(double centerX, double centerY, double radius)
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
-
-