java.lang.ObjectColorScale
public class ColorScale
Represents an n-color scale as a smooth transition between the two terminal colors in the scale.
| Constructor Summary | |
|---|---|
ColorScale()
Constructs a default (gray) scale from white to black with 10 levels. |
|
ColorScale(Color first,
Color last,
int size)
Constructs a scale from first to last values specified, with the specified number of levels. |
|
| Method Summary | |
|---|---|
Color |
get(int level)
Returns a reference to the specified color level. |
int |
size()
Returns the size of the scale. |
| Methods inherited from class java.lang.Object |
|---|
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
| Constructor Detail |
|---|
public ColorScale()
public ColorScale(Color first,
Color last,
int size)
first - the first color value.last - the last color value.size - the number of levels - assumed to be > 0.| Method Detail |
|---|
public Color get(int level)
level - the color level to get - assumed to
be in range of 0 to size()-1.
public int size()