Here you can find the source of deriveWithAlpha(Color color, int alpha)
Parameter | Description |
---|---|
color | Original color. |
alpha | Alpha value for new color. |
public static Color deriveWithAlpha(Color color, int alpha)
//package com.java2s; //License from project: Open Source License import java.awt.Color; public class Main { /**//from ww w.jav a 2 s. com * Creates a new color with the same color components but a different * alpha value. * * @param color Original color. * @param alpha Alpha value for new color. * @return New color with specified alpha value. */ public static Color deriveWithAlpha(Color color, int alpha) { return new Color(color.getRed(), color.getGreen(), color.getBlue(), alpha); } }