Skip to content

Instantly share code, notes, and snippets.

@puelocesar
Created March 22, 2014 17:21
Show Gist options
  • Save puelocesar/9710910 to your computer and use it in GitHub Desktop.
Save puelocesar/9710910 to your computer and use it in GitHub Desktop.
float r = Color.red(obj.color)/255.0f;
float g = Color.green(obj.color)/255.0f;
float b = Color.blue(obj.color)/255.0f;
float[] matrix = {
r, r, r, r, r, //red
g, g, g, g, g, //green
b, b, b, b, b, //blue
1, 1, 1, 1, 1 //alpha
};
color_paint = new Paint();
color_paint.setAntiAlias(true);
color_paint.setColorFilter(new ColorMatrixColorFilter(matrix));
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment