public static double[] getColor(double n, double range) {
        //0 to range
        n = n % range;
        double mag = 255.0/2;
        System.out.println(n);
        //lightness goes from 0 to 100
        //each color then oscillates from -100 to 155
        double[] r = new double[3];
        //each color offset by 2pi/3 = 60 degrees
        //@n = 0 --> offset so that they are all -1 sin(3pi/2)
        //@n = range --> offset so that they are all 1 sin(pi/2)

        for (int i = 0; i < 3; i++) {
            r[i] = mag * Math.sin((n / (range / 3)) + ((i + 1) * (Math.PI * 2.0 / 3))) + mag - (range - n) / range * 255 / 2;
            if (r[i] < 0) {
                r[i] = 0;
            }
        }
        System.out.println(Arrays.toString(r));
        return r;
    }