public class Gradient
extends java.lang.Object
Constructor and Description |
---|
Gradient()
Construct a default gradient black to white
|
Gradient(double[] pos,
java.awt.Color[] colors)
Construct a gradient from a set of color and position
|
Modifier and Type | Method and Description |
---|---|
int |
addEntry(java.awt.Color c,
double pos)
Adds a color,pos entry to the gradient
Note that you have by default 2 entries at 0.0 and 1.0
|
void |
buidColorGradient()
Deprecated.
|
int[] |
buildColorMap(int nb)
Build a color map for this gradient.
|
void |
buildRainbowGradient()
Construct a rainbow gradient.
|
Gradient |
cloneMe()
Returns a copy of this gradient
|
java.awt.Color |
getColorAt(int id)
Returns color information for the specified entry
|
int |
getEntryNumber()
Returns number of color entry.
|
double |
getPosAt(int id)
Returns the specified pos for the specified entry
|
void |
invertGradient()
Invert color entries.
|
void |
removeEntry(int id)
Removes a color entry
|
void |
setColorAt(int id,
java.awt.Color c)
Sets the color for a specified entry.
|
void |
setPosAt(int id,
double pos)
Sets the position for a specified id.
|
public Gradient()
public Gradient(double[] pos, java.awt.Color[] colors)
pos
- Color positionscolors
- Colorspublic void buidColorGradient()
public void buildRainbowGradient()
public void invertGradient()
public Gradient cloneMe()
public int[] buildColorMap(int nb)
nb
- Number of color for the colormappublic int getEntryNumber()
public java.awt.Color getColorAt(int id)
id
- Entry idpublic double getPosAt(int id)
id
- Entry idpublic void setColorAt(int id, java.awt.Color c)
id
- Entry idc
- New color valuepublic void setPosAt(int id, double pos)
id
- Entry idpos
- New position valuepublic int addEntry(java.awt.Color c, double pos)
c
- Color valuepos
- Position [0.0 => 1.0]public void removeEntry(int id)
id
- Entry id (Cannot be fisrt or last value)