List of usage examples for java.awt Color getTransparency
public int getTransparency()
From source file:Main.java
public static void main(String[] args) { Color myColor = Color.RED; System.out.println(myColor.getTransparency()); }
From source file:Main.java
public static double getAlpha(Color color, Composite composite) { int trans = color.getTransparency(); if ((trans == Color.TRANSLUCENT || trans == Color.BITMASK)) { return color.getAlpha() / 255d; }//from w w w . j a v a2 s .c o m if (composite instanceof AlphaComposite) { AlphaComposite ac = (AlphaComposite) composite; return ac.getAlpha(); } return 1d; }