Class GradientColor
- java.lang.Object
-
- org.pepstock.charba.client.commons.NativeObjectContainer
-
- org.pepstock.charba.client.colors.GradientColor
-
public final class GradientColor extends NativeObjectContainer
Contains the color and its offset to set a gradient.- Author:
- Andrea "Stock" Stocchero
-
-
Field Summary
Fields Modifier and Type Field Description static double
DEFAULT_OFFSET_START
Offset 0 defined as default start.static double
DEFAULT_OFFSET_STOP
Offset 1 defined as default stop.
-
Constructor Summary
Constructors Constructor Description GradientColor(double offset, String color)
Creates a stopping gradient with its offset.GradientColor(double offset, IsColor color)
Creates a stopping gradient with its offset.
-
Method Summary
All Methods Static Methods Instance Methods Concrete Methods Modifier and Type Method Description static void
checkOffsetWithinBounds(double offset)
Any double between 0.0d and 1.0d (inclusive) is valid.IsColor
getColor()
Returns the color of the gradient.String
getColorAsString()
Returns the color of the gradient.double
getOffset()
Returns the defined offset for stopping gradient color.String
toString()
-
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, 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
-
-
-
-
Field Detail
-
DEFAULT_OFFSET_START
public static final double DEFAULT_OFFSET_START
Offset 0 defined as default start.- See Also:
- Constant Field Values
-
DEFAULT_OFFSET_STOP
public static final double DEFAULT_OFFSET_STOP
Offset 1 defined as default stop.- See Also:
- Constant Field Values
-
-
Constructor Detail
-
GradientColor
public GradientColor(double offset, IsColor color)
Creates a stopping gradient with its offset.- Parameters:
offset
- offset of colorcolor
- color instance
-
GradientColor
public GradientColor(double offset, String color)
Creates a stopping gradient with its offset.- Parameters:
offset
- offset of colorcolor
- color instance
-
-
Method Detail
-
getOffset
public double getOffset()
Returns the defined offset for stopping gradient color.- Returns:
- the defined offset for stopping gradient color.
-
getColorAsString
public String getColorAsString()
Returns the color of the gradient.- Returns:
- the color of the gradient.
-
getColor
public IsColor getColor()
Returns the color of the gradient.- Returns:
- the color of the gradient.
-
checkOffsetWithinBounds
public static void checkOffsetWithinBounds(double offset)
Any double between 0.0d and 1.0d (inclusive) is valid.- Parameters:
offset
- value between 0 and 1 for where the color stop is located.
-
-