dishevelled.org color-scheme provides color schemes, a means of mapping a range of numerical values to a discrete or continuous gradient of colors. The color-scheme library requires java version 1.5 or later.
The color-scheme library contains a suite of pre-defined color schemes, referenceable by name in discrete and continuous forms. The images below show the gradient of colors for a range of input values, 0.0d to 1.0d.
A continuous color scheme interpolates colors for all intermediate values.
// continuous blues color scheme, with four colors, values interpolated linearly ColorScheme continuousBlues4 = ColorSchemes.getContinuousColorScheme("blues", 4, Interpolations.LINEAR);
A discrete color scheme provides only those colors defined in the color scheme.
// discrete blues color scheme, with seven colors, values interpolated linearly ColorScheme discreteBlues7 = ColorSchemes.getDiscreteColorScheme("blues", 7, Interpolations.LINEAR);
A complete color scheme reference is available. Color scheme names must be converted to lowercase-with-dashes form before lookup, e.g. "RdYlBu" to "rd-yl-bu".