Change Color Transparency - Java 2D Graphics

Java examples for 2D Graphics:Color

Description

Change Color Transparency

Demo Code


//package com.java2s;
import java.awt.*;

public class Main {
    public static Color ChangeTransparency(Color c, double n) {
        return new Color(c.getRed(), c.getGreen(), c.getBlue(),
                (int) (n * 255));
    }//  ww  w . j  a  va  2  s.  c  o m
}

Related Tutorials