如何使用 ColorMatrix 改变位图的色温?

How to change Bitmap'sColor Temperature using ColorMatrix?

如何更改位图的色温?

我尝试了网上找到的这个方法:

 ColorMatrix colorMatrix = new ColorMatrix();

 colorMatrix.set(new float[] {
            temp/255.0f, 0, 0, 0, 0,
             0, temp/255.0f, 0, 0, 0
             0, 0, temp/255.0f, 0, 0,
             0, 0, 0, 1, 0}); 
// temp is the float i change with seekbar's progress
//i replace 255.0f with values from below's link!

http://www.vendian.org/mncharity/dir3/blackbody/UnstableURLs/bbr_color.html

你确定你说的不是 ColorFilter 吗?

Drawable drawable = new BitmapDrawable(bmp);
drawable.setColorFilter(warmColor, PorterDuff.Mode.MULTIPLY);