Class GradientColorScale

java.lang.Object
org.jfree.chart3d.renderer.AbstractColorScale
org.jfree.chart3d.renderer.GradientColorScale
All Implemented Interfaces:
Serializable, ColorScale

public class GradientColorScale extends AbstractColorScale implements ColorScale
A color scale that runs a linear gradient between two colors.

NOTE: This class is serializable, but the serialization format is subject to change in future releases and should not be relied upon for persisting instances of this class.
Since:
1.1
See Also:
  • Constructor Details

    • GradientColorScale

      public GradientColorScale(Range range, Color lowColor, Color highColor)
      Creates a new instance with the specified value range and colors.
      Parameters:
      range - the data value range (null not permitted).
      lowColor - the color for the low end of the data range (null not permitted).
      highColor - the color for the high end of the data range (null not permitted).
  • Method Details

    • getLowColor

      public Color getLowColor()
      Returns the color for the low end of the data value range.
      Returns:
      The color (never null).
    • getHighColor

      public Color getHighColor()
      Returns the color for the high end of the data value range.
      Returns:
      The color (never null).
    • getSampleCount

      public int getSampleCount()
      Returns the number of samples used by this color scale.
      Returns:
      The number of samples.
    • valueToColor

      public Color valueToColor(double value)
      Returns the color corresponding to the specified data value. If this
      Specified by:
      valueToColor in interface ColorScale
      Parameters:
      value - the data value.
      Returns:
      The color (never null).
    • equals

      public boolean equals(Object obj)
      Tests this instance for equality with an arbitrary object.
      Overrides:
      equals in class AbstractColorScale
      Parameters:
      obj - the object (null permitted).
      Returns:
      A boolean.