class ColorUtilities {

    public static Color darken(Color input, double factor)
    {
        if (factor < BRIGHTNESS_FACTOR_MIN || factor > BRIGHTNESS_FACTOR_MAX)
        {
            throw new IllegalArgumentException("Color brighten factor must be between 0.01 and 0.99");
        }

        return new Color(Math.max((int)(input.getRed() * factor), 0), Math.max((int)(input.getGreen() * factor), 0),
                Math.max((int)(input.getBlue() * factor), 0), input.getAlpha());
    }

    private  ColorUtilities();

}