0
我可以将颜色过滤器应用于绘图板,但指定我想要的颜色的颜色?例如:我的drawable结果是两个正方形的组合,一个正方形是红色(#FF0000),另一个正方形是蓝色(#0000FF)。我想要一个函数返回一个Drawable,我通过现有的颜色,我想改变和我想要应用的新颜色。我怎么看它Android - 可绘制,将颜色过滤器应用于特定颜色
代码示例:
private Drawable switchColorOnDrawable(Drawable mySquares, int existingColor, int replaceColor){
//mySquare -> represents my image
//existingColor -> the color I do want to switch
//replaceColor -> the new color that should be replaced
//TODO -> ???
return mySquares;
}
编辑:最低SDK版本= 17
如何我EffectFactory工作?你会推荐哪种方法,在文档列表中,似乎没有任何东西符合我的需求 – Bugdr0id