Java examples for 2D Graphics:Color Dark
Get Darker Version Of Current Color
import java.applet.Applet; import java.awt.Color; import java.awt.Graphics; public class Main { public void paint(Graphics g){ Color customColor = new Color(255,10,10); Color darkerColor = customColor.darker(); // this.setForeground(darkerColor); g.drawString("Darker Color", 80, 10); }/*from w w w. j a v a2 s. c om*/ }