+
+ private Color getColorAt(double value) { // 0.0 to 1.0
+ double localRange = 1.0 / (colors.length - 1);
+ int index = (int)(value / localRange);
+ double localValue = (value / localRange) - index;
+ if (index == colors.length - 1) {
+ return colors[colors.length - 1];
+ } else {
+ return colors[index].interpolate(colors[index + 1], localValue);
+ }
+ }