Here you can find the source of darker(Color c, double factor)
public static Color darker(Color c, double factor)
//package com.java2s; /*//from ww w. j av a 2s .co m * @(#)QuaquaUtilities.java * * Copyright (c) 2003-2013 Werner Randelshofer, Switzerland. * You may not use, copy or modify this file, except in compliance with the * accompanying license terms. */ import java.awt.*; public class Main { public static Color darker(Color c, double factor) { return new Color(Math.max((int) (c.getRed() * factor), 0), Math.max((int) (c.getGreen() * factor), 0), Math.max( (int) (c.getBlue() * factor), 0), c.getAlpha()); } }