public static Color hsvToColor(float hh, int ss, int vv) {
        float r, g, b;

        float h = Math.max(0, Math.min(360, hh)) / 60f;
        float s = Math.max(0, Math.min(100, ss)) / 100f;
        float v = Math.max(0, Math.min(100, vv)) / 100f;

        int i = (int) Math.floor(h);
        float f = h - i; // factorial part of h
        float p = v * (1 - s);
        float q = v * (1 - s * f);
        float t = v * (1 - s * (1 - f));
        switch(i) {
            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;
            default:r = v; g = p; b = q;
        }
        return new Color(Math.round(r * 255), Math.round(g * 255), Math.round(b * 255));
    }