java.lang.Object
omix.lang.Gradient
- All Implemented Interfaces:
Serializable
,Brush
,Paint
- Direct Known Subclasses:
LinearGradient
,RadialGradient
public abstract class Gradient extends Object implements Brush, Serializable
This class is superclass for all color gradients.
A gradient consists of at least two colors which are associated to 0.0 and 1.0.
Further color stops can be inserted at values between 0.0 and 1.0.
Additionally, a gradient defines the spread of the color along the filled shape.
- Author:
- Dr. Peter Droste, Omix Visualization
- See Also:
- Serialized Form
-
Nested Class Summary
Nested Classes Modifier and Type Class Description static class
Gradient.Spread
This enum lists all available spread for color gradients. -
Method Summary
Modifier and Type Method Description abstract Gradient
clone()
Color
colorAt(double stop)
Checks the color at the submitted stop value.boolean
equals(Object obj)
Gradient.Spread
getSpread()
Map<Double,Color>
getStops()
int
hashCode()
void
setColorAt(double stop, Color color)
Inserts a new color at the submitted stop value.void
setSpread(Gradient.Spread spread)
Changes the spread of the gradient.Set<Double>
stops()
returns a list of all available stops in the gradient.
-
Method Details
-
getSpread
-
setSpread
Changes the spread of the gradient.- Parameters:
spread
-
-
setColorAt
Inserts a new color at the submitted stop value. If the stop value is already existing in the gradient the color is simply exchanged.- Parameters:
stop
- value in range of 0.0 to 1.0color
-
-
colorAt
Checks the color at the submitted stop value.- Parameters:
stop
-- Returns:
- the color associated to
stop
. If unavailable:null
-
stops
returns a list of all available stops in the gradient.- Returns:
- list of stops
-
clone
-
getStops
- Returns:
- the stops
-
hashCode
public int hashCode() -
equals
-