public static double[] toRGB(double h, double s, double l) {
        double c = (1 - Math.abs(2 * l - 1)) * s;
        double x = c * (1 - Math.abs((h / 60) % 2 - 1));
        double m = l - c / 2;
        double[] arr = new double[0];
        if (h < 60) {
            arr = new double[]{c, x, 0};
        } else if (h < 120) {
            arr = new double[]{x, c, 0};
        } else if (h < 180) {
            arr = new double[]{0, c, x};
        } else if (h < 240) {
            arr = new double[]{0, x, c};
        } else if (h < 300) {
            arr = new double[]{x, 0, c};
        } else if (h <= 360) {
            arr = new double[]{c, 0, x};
        }
        for (int i = 0; i < 3; i++) {
            arr[i] += m;
            arr[i] *= 255;
        }
        return arr;
    }