de.erichseifert.gral.plots.colors
Class LinearGradient
- java.lang.Object
-
- de.erichseifert.gral.plots.colors.AbstractColorMapper<java.lang.Double>
-
- de.erichseifert.gral.plots.colors.ContinuousColorMapper
-
- de.erichseifert.gral.plots.colors.ScaledContinuousColorMapper
-
- de.erichseifert.gral.plots.colors.LinearGradient
-
- All Implemented Interfaces:
- ColorMapper, java.io.Serializable
public class LinearGradient extends ScaledContinuousColorMapper
Linearly blends different colors for values between 0.0 and 1.0.- See Also:
- Serialized Form
-
-
Nested Class Summary
-
Nested classes/interfaces inherited from interface de.erichseifert.gral.plots.colors.ColorMapper
ColorMapper.Mode
-
-
Constructor Summary
Constructors Constructor and Description LinearGradient(java.awt.Color color1, java.awt.Color... colors)Creates a new instance with at least one color.
-
Method Summary
All Methods Instance Methods Concrete Methods Modifier and Type Method and Description java.awt.Paintget(double value)Returns the Paint according to the specified value.java.util.List<java.awt.Color>getColors()Returns the colors that are used for blending.voidsetMode(ColorMapper.Mode mode)Sets how values outside of the mapping range will be handled.-
Methods inherited from class de.erichseifert.gral.plots.colors.ScaledContinuousColorMapper
equals, getOffset, getScale, hashCode, setOffset, setRange, setScale
-
Methods inherited from class de.erichseifert.gral.plots.colors.ContinuousColorMapper
get
-
Methods inherited from class de.erichseifert.gral.plots.colors.AbstractColorMapper
getMode
-
-
-
-
Constructor Detail
-
LinearGradient
public LinearGradient(java.awt.Color color1, java.awt.Color... colors)Creates a new instance with at least one color.- Parameters:
color1- First color.colors- Additional colors.
-
-
Method Detail
-
get
public java.awt.Paint get(double value)
Returns the Paint according to the specified value.- Specified by:
getin classContinuousColorMapper- Parameters:
value- Value of color.- Returns:
- Paint.
-
setMode
public void setMode(ColorMapper.Mode mode)
Description copied from class:AbstractColorMapperSets how values outside of the mapping range will be handled.- Parameters:
mode- Handling of values outside of the mapping range.
-
getColors
public java.util.List<java.awt.Color> getColors()
Returns the colors that are used for blending.- Returns:
- A list of colors in the order they will be used for blending.
-
-
DataMelt 3.0 © DataMelt by jWork.ORG