Package de.xima.fc.common.graphdot
Class WeighedColor
- java.lang.Object
-
- de.xima.fc.common.graphdot.WeighedColor
-
- All Implemented Interfaces:
Serializable
,CharSequence
public final class WeighedColor extends Object
A weighted color, used in color lists for gradients etc.green;0.33
- Since:
- 8.2.0
- Author:
- XIMA MEDIA GmbH
- See Also:
- Serialized Form
-
-
Constructor Summary
Constructors Constructor Description WeighedColor(Color color, Double weight)
Creates a new weighted color with the given weight.
-
Method Summary
All Methods Static Methods Instance Methods Concrete Methods Default Methods Modifier and Type Method Description default char
charAt(int index)
default IntStream
chars()
default IntStream
codePoints()
boolean
equals(Object obj)
Color
getColor()
OptionalDouble
getWeight()
int
hashCode()
default int
length()
default CharSequence
subSequence(int start, int end)
String
toString()
static WeighedColor
unweighed(Color color)
Creates new color with no weight.static WeighedColor
weighed(Color color, double weight)
Creates new color with the given weight.
-
-
-
Method Detail
-
getColor
public Color getColor()
- Returns:
- The color being weighted.
-
getWeight
public OptionalDouble getWeight()
- Returns:
- The weight of the color.
-
toString
public String toString()
- Specified by:
toString
in interfaceCharSequence
-
unweighed
public static WeighedColor unweighed(Color color)
Creates new color with no weight.- Parameters:
color
- Color to use.- Returns:
- A new color with no weight.
-
weighed
public static WeighedColor weighed(Color color, double weight)
Creates new color with the given weight.- Parameters:
color
- Color to use.weight
- Weight to use.- Returns:
- A new weighted color.
-
charAt
public default char charAt(int index)
- Specified by:
charAt
in interfaceCharSequence
-
chars
public default IntStream chars()
- Specified by:
chars
in interfaceCharSequence
-
codePoints
public default IntStream codePoints()
- Specified by:
codePoints
in interfaceCharSequence
-
length
public default int length()
- Specified by:
length
in interfaceCharSequence
-
subSequence
public default CharSequence subSequence(int start, int end)
- Specified by:
subSequence
in interfaceCharSequence
-
-