Get Darker Version Of Current Color - Java 2D Graphics

Java examples for 2D Graphics:Color Dark

Description

Get Darker Version Of Current Color

Demo Code

 
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*/
}

Related Tutorials