Java examples for 2D Graphics:Color Dark
make Color Darker
//package com.java2s; import java.awt.Color; public class Main { public static Color makeDarker(Color curColor, int distance) { int red = curColor.getRed(); int green = curColor.getGreen(); int blue = curColor.getBlue(); red -= distance;// ww w .j a v a 2 s . c om green -= distance; blue -= distance; if (red < 0) red = 0; if (green < 0) green = 0; if (blue < 0) blue = 0; return new Color(red, green, blue); } }