I am searching for from last 2 days to implement color palette like this image. I want exatract the colors from the image. Please help me.
Thanks in advance.
I am searching for from last 2 days to implement color palette like this image. I want exatract the colors from the image. Please help me.
Thanks in advance.
from the docs: https://developer.android.com/reference/android/support/v7/graphics/Palette.html
make sure your application have the support libraries
import android.support.v7.graphics.Palette
<<< VERY IMPORTANT
and just run the pallete code as per example
Palette.generateAsync(bitmap, new Palette.PaletteAsyncListener() {
public void onGenerated(Palette palette) {
Palette.Swatch swatch = palette.getDarkVibrantSwatch();
int backgroundColor = swatch.getRgb();
int titleColor = swatch.getTitleTextColor();
int textColor = swatch.getBodyTextColor();
}
});
edit:
as pointed by @CommonsWare, this is how to setup build.gradle to import the library.
// inside your dependencies object
dependencies {
compile 'com.android.support:palette-v7:21.0.3'
// all your other dependencies
}