Here you can find the source of darker(int channel, int intensity)
private static int darker(int channel, int intensity)
//package com.java2s; //License from project: LGPL import java.awt.Color; public class Main { public static Color darker(Color color, int intensity) { int a = color.getAlpha(); int r = darker(color.getRed(), intensity); int g = darker(color.getGreen(), intensity); int b = darker(color.getBlue(), intensity); Color darker = new Color(r, g, b, a); return darker; }/*from ww w . jav a 2 s . c o m*/ private static int darker(int channel, int intensity) { int color = channel - intensity; if (color < 0) { color = 0; } return color; } }