public interface ColorModel
A model for generating colors given an integer index. The colors are generated according to some internal formula and have a period at which they sequence repeats.
Color Models are initialised using a string descriptor, which defines the start and end colors for the gradient. Multiple gradients can be defined in one descriptor. A simple descriptor example is as follows:
(length=1,start=black,end=white)
For simple gradients, any non zero length can be used and is not significant. This attains meaning when multiple gradients are described, eg.
This will define two gradients, with the second one being double the length
of the first. These lengths are only relative, so any numeric value can be used.
The colors can be defined using the name, eg. "yellow" or a hex triplet, eg. "#ffff00".(length=1,start=black,end=red)(length=2,start=red,end=yellow)
void setPeriod(int period)
period
- the period of repetitionjava.awt.Color getColor(int index)
index
- the index