Java set transparency on Color.color WITHOUT using rgb's -


i'm woundering, there way set transparency on color without using rgb's. example can

color color = new color(255,255,255,transparency)  

but want use way

color = new color(color.red,transparency) 

it doesn't there's such method or constructor @ moment, it's dead easy write helper method:

public static color newcolorwithalpha(color original, int alpha) {     return new color(color.getred(), color.getgreen(), color.getblue(), alpha); } 

you can import statically, @ point you'd have:

color color = newcolorwithalpha(color.red, alpha); 

Comments

Popular posts from this blog

javascript - AngularJS custom datepicker directive -

javascript - jQuery date picker - Disable dates after the selection from the first date picker -