Here you can find the source of darken(Color col)
private static Color darken(Color col)
//package com.java2s; //License from project: Open Source License import java.awt.Color; public class Main { private static Color darken(Color col) { float[] hsv = Color.RGBtoHSB(col.getRed(), col.getGreen(), col.getBlue(), null);//from w w w . ja va 2s .c o m hsv[2] = hsv[2] * 0.4f; int newCol = Color.HSBtoRGB(hsv[0], hsv[1], hsv[2]); return new Color(newCol); } }