Skip to content

Instantly share code, notes, and snippets.

@ParkSangGwon
Created October 27, 2016 09:29
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save ParkSangGwon/19673335a6a39e50082b45e78fb1cdab to your computer and use it in GitHub Desktop.
Save ParkSangGwon/19673335a6a39e50082b45e78fb1cdab to your computer and use it in GitHub Desktop.
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