private void recalculateBarGradient() {
        double angleFactor = 1d / 360d;
        double emptyRange  = 360d - getSkinnable().getAngleRange();
        double offset      = angleFactor * ((360 - getSkinnable().getStartAngle() + 180 - emptyRange * 0.5) % 360);
        List<Stop> stops   = new LinkedList<>();

        double emptyOffset = (emptyRange * 0.5) * angleFactor;

        double minFraction = 1.0;
        double maxFraction = 0.0;
        Color  minFractionColor = Color.TRANSPARENT;
        Color  maxFractionColor = Color.TRANSPARENT;

        for (Stop stop : getSkinnable().getBarGradient()) {
            double fraction = stop.getOffset();
            if (fraction < minFraction) {
                minFraction      = fraction;
                minFractionColor = stop.getColor();
            }
            if (fraction > maxFraction) {
                maxFraction      = fraction;
                maxFractionColor = stop.getColor();
            }
        }
        stops.add(new Stop(0d, minFractionColor));
        stops.add(new Stop(0d + emptyOffset, minFractionColor));
        stops.add(new Stop(1d - emptyOffset, maxFractionColor));
        stops.add(new Stop(1d, maxFractionColor));
        if (getSkinnable().getBarGradient().size() == 2) {
            stops.add(new Stop((maxFraction - minFraction) * 0.5, (Color) Interpolator.LINEAR.interpolate(minFractionColor, maxFractionColor, 0.5)));
        }
        for (Stop stop : getSkinnable().getBarGradient()) {
            if (Double.compare(stop.getOffset(), minFraction) == 0 || Double.compare(stop.getOffset(), maxFraction) == 0) continue;
            stops.add(stop);
        }
        barGradient = new ConicalGradient(new Point2D(size * 0.5, size * 0.5), offset, stops);
    }