Created
October 27, 2016 09:29
-
-
Save ParkSangGwon/19673335a6a39e50082b45e78fb1cdab to your computer and use it in GitHub Desktop.
PaletteSample
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
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