I'm woundering, is there a way to set transparency on a color without using rgb's. For example you can do this
Color color = new Color(255,255,255,Transparency)
but I want to use it this way
Color = new Color(Color.red,Transparency)
It doesn't look like there's any such method or constructor at the moment, but it's dead easy to write a helper method:
public static Color newColorWithAlpha(Color original, int alpha) {
return new Color(color.getRed(), color.getGreen(), color.getBlue(), alpha);
}
You can import that statically, at which point you'd have:
Color color = newColorWithAlpha(Color.red, alpha);
See more on this question at Stackoverflow