public interface ColorMap
Modifier and Type | Method and Description |
---|---|
double |
defaultValue()
Returns some level which is valid (that is, validLevel(defaultValue()) should
always return true).
|
int |
getAlpha(double level)
Returns the alpha value for a color for the given level.
|
java.awt.Color |
getColor(double level)
Returns a color for the given level
|
int |
getRGB(double level)
Returns the RGB values, plus alpha, for a color for the given level.
|
boolean |
validLevel(double level)
Returns true if a level is "valid" (it provides a meaningful color)
|
java.awt.Color getColor(double level)
int getRGB(double level)
Why isn't this called getRGBA(...)? Because for some reason the underlying Color
method is likewise getRGB(), even though it ought to be called getRGBA().
... however it's likely that this method could be written more efficiently than this.
int getAlpha(double level)
return getRGB(level) >>> 24 ;
...or it could be written as:
return getColor(level).getAlpha()
...however it's likely that it this method could be written more efficiently than either of these.
boolean validLevel(double level)
double defaultValue()