Java examples for 2D Graphics:Color RGB
How to create a custom color using red, green and blue (RGB) components
import java.applet.Applet; import java.awt.Color; import java.awt.Graphics; public class Main { public void paint(Graphics g) { Color customColor = new Color(10,10,255); g.drawString("This is a custom RGB color", 10, 50); }//from w ww.j a v a2s. c o m }