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:
  • Constructor Details

    • WeighedColor

      public WeighedColor(Color color, Double weight)
      Creates a new weighted color with the given weight.
      Parameters:
      color - Color to use.
      weight - Weight of the color may be null for no weight.
  • Method Details

    • 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 interface CharSequence
    • 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.
    • equals

      public final boolean equals(Object obj)
      Overrides:
      equals in class Object
    • hashCode

      public final int hashCode()
      Overrides:
      hashCode in class Object
    • charAt

      default char charAt(int index)
      Specified by:
      charAt in interface CharSequence
    • chars

      default IntStream chars()
      Specified by:
      chars in interface CharSequence
    • codePoints

      default IntStream codePoints()
      Specified by:
      codePoints in interface CharSequence
    • length

      default int length()
      Specified by:
      length in interface CharSequence
    • subSequence

      default CharSequence subSequence(int start, int end)
      Specified by:
      subSequence in interface CharSequence