java.lang.Object
org.jfree.chart3d.renderer.AbstractColorScale
org.jfree.chart3d.renderer.RainbowScale
- All Implemented Interfaces:
Serializable
,ColorScale
A color scale that returns all the colors of the rainbow. Instances of
this class are immutable and serializable.
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.
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:
-
Field Summary
Fields -
Constructor Summary
ConstructorsConstructorDescriptionRainbowScale
(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. -
Method Summary
Modifier and TypeMethodDescriptionboolean
Tests this color scale for equality with an arbitrary object.Returns the sub-range of hues used in this scale.int
Returns the number of samples used by this color scale.valueToColor
(double value) Converts a value to a color on the scale.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
-
Field Details
-
ALL_HUES
A range to include all hues. This can be used for thehueSubrange
argument in the constructor. -
BLUE_TO_RED_RANGE
A hue subrange that restricts colors to the blue to red range. This can be used for thehueSubrange
argument in the constructor.
-
-
Constructor Details
-
RainbowScale
Creates a new rainbow scale for the specified value range, with 256 color samples in the blue to red range.- Parameters:
range
- the range (null
not permitted).
-
RainbowScale
Creates a new rainbow scale for the specified value range, with the given number of samples and hues restricted to the specified range.- Parameters:
range
- the range (null
not permitted).samples
- the number of samples.hueSubrange
- the hue sub-range.
-
-
Method Details
-
getSampleCount
Returns the number of samples used by this color scale.- Returns:
- The number of samples.
-
getHueSubrange
Returns the sub-range of hues used in this scale.- Returns:
- The sub-range of hues.
-
valueToColor
Converts a value to a color on the scale.- Specified by:
valueToColor
in interfaceColorScale
- Parameters:
value
- the value.- Returns:
- A color (never
null
).
-
equals
Tests this color scale for equality with an arbitrary object.- Overrides:
equals
in classAbstractColorScale
- Parameters:
obj
- the object (null
permitted).- Returns:
- A boolean.
-