Java Color Alpha changeAlpha(Color c, double alpha)

Here you can find the source of changeAlpha(Color c, double alpha)

Description

change Alpha

License

GNU General Public License

Declaration

public static Color changeAlpha(Color c, double alpha) 

Method Source Code

//package com.java2s;
/***************************************
 *            ViPER                    *
 *  The Video Processing               *
 *         Evaluation Resource         *
 *                                     *
 *  Distributed under the GPL license  *
 *        Terms available at gnu.org.  *
 *                                     *
 *  Copyright University of Maryland,  *
 *                      College Park.  *
 ***************************************/

import java.awt.*;

public class Main {
    public static Color changeAlpha(Color c, double alpha) {
        return new Color(c.getRed(), c.getGreen(), c.getBlue(), (int) (alpha * 255));
    }//from ww w  .j  a v a2  s  .c  om
}

Related

  1. applyColorFilter(Image image, Color color, float alpha)
  2. buildColorRamp(Color startColor, Color endColor, int numColors, int alpha)
  3. changeAlpha(Color c, double newAlpha)
  4. changeAlpha(Color c, int alpha)
  5. changeColorAlpha(@Nonnull Color color, int newAlpha)
  6. deriveWithAlpha(Color color, int alpha)