tint color image to grayscale
in
Programming Questions
•
6 months ago
i have been working on showing some icons
all the icons are in different colors,but any one of them only has two colors,let's say,red and white.
When it's selected,it's itself.But when the icon is not select,it should be totally gray-scale,which means the red goes to gray but white stays white.And the whole icon shows a little transparency.
i have tried tint(gray,alpha),for example,tint(100,100),it turned out that the whole icon goes a little bit transparent,but the color is not right,the red goes more gray and dark but still looks red .More annoying,the white goes gray too!! I really don't want white to change.
How should i change the tint() to fulfill my idea??
Since my project is on Android,I don't want to put too many images into the project(it's now pretty large).So tint() must be used??Or any other method??
1