private void hsvToRgb(float h, float s, float v) {
        int hh = (int) (h * 6);
        float f = (h * 6 - hh);
        float p = (v * (1 - s));
        float q = (v * (1 - f * s));
        float t = (v * (1 - (1 - f) * s));

        switch (hh) {
            case 0:
                r = v;
                g = t;
                b = p;
                break;
            case 1:
                r = q;
                g = v;
                b = p;
                break;
            case 2:
                r = p;
                g = v;
                b = t;
                break;
            case 3:
                r = p;
                g = q;
                b = v;
                break;
            case 4:
                r = t;
                g = p;
                b = v;
                break;
            case 5:
                r = v;
                g = p;
                b = q;
                break;
        }
    }