public static double[] getColor2(double n, double range) {
        n %= range;
        double[] r = new double[3];
        //1 @ n == 0.
        //0 @ n == range
        double GAMMA = .85;
        double mag = 255 / 2 - (255/2* (range - n)/range) * GAMMA;
        for (int i = 0; i < 3; i++) {
            double offset = i * Math.PI * 2.0/3;
            r[i] = mag * Math.sin((n / (range / 6)) + offset) + mag;
            if (r[i] < 0) {
                r[i] = 0;
            }
        }
        return r;

    }