Get Transparency Mode Of Color - Java 2D Graphics

Java examples for 2D Graphics:Color

Description

Get Transparency Mode Of 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);
           /*from   ww w. jav a  2s.com*/
            int transparency = customColor.getTransparency();
           
            g.drawString("Transparency mode : " + transparency, 10,50);
    }
}

Related Tutorials