Java
Switch branches/tags
Nothing to show
Clone or download
Fetching latest commit…
Cannot retrieve the latest commit at this time.
Permalink
Failed to load latest commit information.
.idea
app
gradle/wrapper
.gitignore
Androdpalettedemo.iml
README.md
build.gradle
gradle.properties
gradlew
gradlew.bat
settings.gradle

README.md

android-support-v7-palette-example

This is demostration of how to extract color from bitmap using android palette support library. As show below.

first_01 second third

Steps 1: Add this into build.gradle.

compile 'com.android.support:palette-v7:+'

Step 2: Provide the bitmap to fecth swatch list containing rgb values as shown below.

    Palette.from(bitmap).generate(new Palette.PaletteAsyncListener() {
        @Override
        public void onGenerated(Palette palette) {
            swatchesList = palette.getSwatches();
        }
    });
}

We get titleText, bodyText, RGB, HSL (Hue, Saturation, Lightness) respectively.

This example too extract the rgb value from the drawable and display it into the background of parent layout using interval of 1sec.