Class Gradient
- java.lang.Object
-
- org.pepstock.charba.client.commons.NativeObjectContainer
-
- org.pepstock.charba.client.colors.CanvasObject
-
- org.pepstock.charba.client.colors.Gradient
-
public final class Gradient extends CanvasObject
A gradient is an image consisting of a progressive transition between two or more colors.
Could beLinear
orRadial
.
Can be created using the size ofCANVAS
orCHART
area.
The orientation to have a progressive transition, is defined by an enumeration in order to creates the gradient using the right coordinates and dimension, based on existing items (canvas and chart).- Author:
- Andrea "Stock" Stocchero
-
-
Method Summary
All Methods Instance Methods Concrete Methods Modifier and Type Method Description boolean
equals(Object obj)
List<GradientColor>
getColors()
Returns the unmodifiable list of stopping colors.IsColor
getInterpolatedColorByOffset(double offset)
Returns a color using the gradient as source of colors.GradientOrientation
getOrientation()
Returns the gradient orientation.GradientScope
getScope()
Returns the gradient scope.GradientType
getType()
Returns the gradient type.int
hashCode()
-
Methods inherited from class org.pepstock.charba.client.colors.CanvasObject
getId
-
Methods inherited from class org.pepstock.charba.client.commons.NativeObjectContainer
checkDefaultValuesArgument, empty, getArrayValue, getElement, getIncrementalId, getNativeChart, getNativeEvent, getNativeObject, getValue, getValue, getValue, getValue, getValue, getValue, getValue, getValue, getValue, getValue, getValue, getValue, getValue, getValueForMultipleKeyTypes, getValueForMultipleKeyTypes, getValueForMultipleKeyTypes, getValueOrArray, getValueOrArray, getValueOrArray, getValueOrArray, getValueOrArray, getValueOrArray, getValueOrArray, getValueOrArray, getValueOrArray, has, has, isType, keys, loadNativeObject, remove, remove, setArrayValue, setArrayValue, setArrayValue, setElement, setEmptyValue, setNewIncrementalId, setNewIncrementalId, setValue, setValue, setValue, setValue, setValue, setValue, setValue, setValue, setValue, setValue, setValue, setValue, setValue, setValue, setValue, setValue, setValue, setValue, setValueOrArray, setValueOrArray, setValueOrArray, setValueOrArray, setValueOrArray, setValueOrArray, setValueOrArray, setValueOrArray, setValueOrArray, setValueOrArray, toJSON, type
-
-
-
-
Method Detail
-
getType
public GradientType getType()
Returns the gradient type.- Returns:
- the gradient type
-
getOrientation
public GradientOrientation getOrientation()
Returns the gradient orientation.- Returns:
- the gradient orientation
-
getScope
public GradientScope getScope()
Returns the gradient scope.- Returns:
- the gradient scope
-
getColors
public List<GradientColor> getColors()
Returns the unmodifiable list of stopping colors.- Returns:
- the unmodifiable list of stopping colors.
-
hashCode
public int hashCode()
- Overrides:
hashCode
in classCanvasObject
-
equals
public boolean equals(Object obj)
- Overrides:
equals
in classCanvasObject
-
getInterpolatedColorByOffset
public IsColor getInterpolatedColorByOffset(double offset)
Returns a color using the gradient as source of colors.- Parameters:
offset
- offset to search in the gradient colors- Returns:
- a color based on offset.
-
-