public class RainbowScale extends AbstractColorScale implements ColorScale
| Modifier and Type | Field and Description |
|---|---|
static Range |
ALL_HUES
A range to include all hues.
|
static Range |
BLUE_TO_RED_RANGE
A hue subrange that restricts colors to the blue to red range.
|
| Constructor and Description |
|---|
RainbowScale(Range range)
Creates a new rainbow scale for the specified value range, with 256
color samples in the blue to red range.
|
RainbowScale(Range range,
int samples,
Range hueSubrange)
Creates a new rainbow scale for the specified value range, with the
given number of samples and hues restricted to the specified range.
|
| Modifier and Type | Method and Description |
|---|---|
boolean |
equals(java.lang.Object obj)
Tests this color scale for equality with an arbitrary object.
|
Range |
getHueSubrange()
Returns the sub-range of hues used in this scale.
|
int |
getSampleCount()
Returns the number of samples used by this color scale.
|
java.awt.Color |
valueToColor(double value)
Converts a value to a color on the scale.
|
getRangeclone, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, waitgetRangepublic static final Range ALL_HUES
hueSubrange argument in the constructor.public static final Range BLUE_TO_RED_RANGE
hueSubrange argument in the constructor.public RainbowScale(Range range)
range - the range (null not permitted).public RainbowScale(Range range, int samples, Range hueSubrange)
range - the range (null not permitted).samples - the number of samples.hueSubrange - the hue sub-range.public int getSampleCount()
public Range getHueSubrange()
public java.awt.Color valueToColor(double value)
valueToColor in interface ColorScalevalue - the value.null).public boolean equals(java.lang.Object obj)
equals in class AbstractColorScaleobj - the object (null permitted).