Tuesday 15 June 2010

android - Programmatically make a color more transparent -


I am working on a simple bar graph application that uses a constant array of colors to split bar colors Does. I would like functionality to draw normally or slightly transparent bars.

Is the program a way to adjust an integer so that it is a little transparent? Or will I have to define a transparent version of every color, and then whenever I want transparency, will I switch to using these versions?

Sure ... look at the color and have a function:

  Fixed integer argb (int alpha, int red, int green, en blue)   

Return a color-int from alpha, red, green, blue components.

So your RGB value can be frozen and you give the alpha value to get a new transparent version of the color.

No comments:

Post a Comment