RainbowColors extends ScaledContinuousColorMapper { @Override public Paint get(double value) { Double v = scale(value); v = applyMode(v, 0.0, 1.0); if (!MathUtils.isCalculatable(v)) { return null; } float hue = v.floatValue(); return Color.getHSBColor(hue, 1f, 1f); }  @Override Paint get(double value); @Override void setMode(Mode mode);  }
@Test public void testGet() { RainbowColors c = new RainbowColors(); for (double i = 0.0; i <= 1.0f; i += 0.1f) { assertEquals(Color.getHSBColor((float) i, 1f, 1f), c.get(i)); } }