ColorMatrix colorMatrix = new ColorMatrix();
colorMatrix.setSaturation(0);
float brightness = (float)(bar.getProgress());//it can be 0-128
float m = 205f;
float t = -255*brightness;
ColorMatrix threshold = new ColorMatrix(new float[] {
m, 1, 0, 1, t,
0, m, 1, 1, t,
1, 0, m, 1, t,
0, 1, 0, 1, 0
});
经过上述实施后,图像变得太黑了。