Module org.jfree.chart3d
Package org.jfree.chart3d.renderer

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

## Constructor Summary

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

## Method Summary

Modifier and Type
Method
Description
`boolean`
`equals(Object obj)`
Tests this instance for equality with an arbitrary object.
`Color`
`getHighColor()`
Returns the color for the high end of the data value range.
`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.
`Color`
`valueToColor(double value)`
Returns the color corresponding to the specified data value.

### Methods inherited from class org.jfree.chart3d.renderer.AbstractColorScale

`getRange`

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

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

### Methods inherited from interface org.jfree.chart3d.renderer.ColorScale

`getRange`

## 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.