How to create a custom color using red, green and blue (RGB) components - Java 2D Graphics

Java examples for 2D Graphics:Color RGB

Description

How to create a custom color using red, green and blue (RGB) components

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(10,10,255);
                g.drawString("This is a custom RGB color", 10, 50);
        }//from   w  ww.j a  v  a2s.  c  o  m
}

Related Tutorials