v7.palette可从图像中提取颜色。现在我的问题是我仅限于一个色板,我的问题是如何获得所有色板,允许调色板从图像中提取所有颜色并使用该颜色。请帮助 注意:一切工作正常,调色板是工作正常,但有小的颜色集合使用调色板中的所有颜色色板
public void updateColor(){
final Bitmap bitmap = mImageFetcher.getArtwork(Utils.getAlbumName(),
Utils.getCurrentAlbumId(), Utils.getArtistName());
Palette palette = Palette.generate(bitmap);
// Getting the different types of colors from the Image
Palette.Swatch vibrantSwatch = palette.getVibrantSwatch();
// Adding the colors to the TextViews.
if(vibrantSwatch!=null) {
// Changing the background color of the toolbar to Vibrant Light Swatch
toolbar.setBackgroundDrawable(new ColorDrawable(vibrantSwatch.getRgb()));
if (Build.VERSION.SDK_INT >= 21) { // setStatusBarColor only works above API 21!
getWindow().setStatusBarColor(vibrantSwatch.getRgb());
}
}
}
我已经知道我的问题是如何提取所有从图像中样本(样本充满活力,柔和斯沃琪等...)感谢您的任何帮帮我 –