Color (@NotNull Color color, int componentIndex, int howMuch, float factor) { Checks.checkIndex(componentIndex, 3); float[] hsb = Color.RGBtoHSB(color.getRed(), color.getGreen(), color.getBlue(), null); float component = hsb[componentIndex]; for (int i = 0; i < howMuch; i++) { component = MathUtil.clamp(factor * component, 0, 1); if (component == 0 || component == 1) break; } hsb[componentIndex] = component; return Color.getHSBColor(hsb[0], hsb[1], hsb[2]); }