【发布时间】:2017-12-08 18:46:30
【问题描述】:
我尝试了下面的代码,它返回了我传入参数的特定像素的颜色
int x = (int)event.getX();
int y = (int)event.getY();
int pixel = bitmap.getPixel(x,y);
int redValue = Color.red(pixel);
int blueValue = Color.blue(pixel);
int greenValue = Color.green(pixel);
int[] color={redValue ,blueValue ,greenValue };
btn.setBackgroundColor(getHexColor(color));
public static int getHexColor(int[] color) {
return android.graphics.Color.rgb(color[0], color[1], color[2]);
}
我也尝试过调色板下面的链接是参考链接,也没有返回完美的面部肤色
有人知道如何提取或获取面部肤色吗??
【问题讨论】:
-
显示您的调色板代码
-
medium.com/david-developer/… 试试这个。与毕加索一起使用托盘。如果对你有帮助,请告诉我
-
调色板调色板 = Palette.generate(bitmap); int 默认值 = 0x000000; int充满活力=调色板.getVibrantColor(默认); int VibrantLight = 调色板.getLightVibrantColor(默认); int VibrantDark = 调色板.getDarkVibrantColor(默认); int muted = palette.getMutedColor(default); int mutedLight = palette.getLightMutedColor(默认); int mutedDark = palette.getDarkMutedColor(default);