com.orsoncharts.renderer

## Class GradientColorScale

- java.lang.Object
- - com.orsoncharts.renderer.AbstractColorScale
  - - com.orsoncharts.renderer.GradientColorScale

- All Implemented Interfaces:
    ColorScale, java.io.Serializable

      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:
    Serialized Form

- - ### Constructor Summary

    Constructors
    Constructor and Description
    `GradientColorScale(Range range, java.awt.Color lowColor, java.awt.Color highColor)` Creates a new instance with the specified value range and colors.

  - ### Method Summary

    All Methods Instance Methods Concrete Methods
    Modifier and Type | Method and Description
    --- | ---
    `boolean` | `equals(java.lang.Object obj)` Tests this instance for equality with an arbitrary object.
    `java.awt.Color` | `getHighColor()` Returns the color for the high end of the data value range.
    `java.awt.Color` | `getLowColor()` Returns the color for the low end of the data value range.
    `int` | `getSampleCount()` Returns the number of samples used by this color scale.
    `java.awt.Color` | `valueToColor(double value)` Returns the color corresponding to the specified data value.

    - ### Methods inherited from class com.orsoncharts.renderer.AbstractColorScale

      `getRange`

    - ### Methods inherited from class java.lang.Object

      `clone, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait`

    - ### Methods inherited from interface com.orsoncharts.renderer.ColorScale

      `getRange`

- - ### Constructor Detail

    - #### GradientColorScale

          public GradientColorScale(Range range,
                                    java.awt.Color lowColor,
                                    java.awt.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 Detail

    - #### getLowColor

          public java.awt.Color getLowColor()

      Returns the color for the low end of the data value range.
      Returns:
        The color (never `null`).

    - #### getHighColor

          public java.awt.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 java.awt.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(java.lang.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.