Skip to content

Instantly share code, notes, and snippets.

Embed
What would you like to do?
PaletteSample
Palette.from(bitmap).generate(new Palette.PaletteAsyncListener() {
@Override
public void onGenerated(Palette palette) {
if(palette==null)
return;
Palette.Swatch vibrantSwatch = palette.getVibrantSwatch();
if(vibrantSwatch!=null){
viewVibrant.setBackgroundColor(vibrantSwatch.getRgb());
tvVibrantTitle.setTextColor(vibrantSwatch.getTitleTextColor());
tvVibrantBody.setTextColor(vibrantSwatch.getBodyTextColor());
}
}
});
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment