AndroidColorExtractor is a lightweight and easy-to-use Android library that helps you extract colors from bitmaps. You can quickly get the dominant color, vibrant swatch, muted swatch, and even a complete list of detected colors.
- 🔥 Get dominant, vibrant, and muted colors from any image
- 🎨 Extract all available swatches as hex color strings
- ⚡️ Works with a single method call
- 🧠 Built on top of Android's Palette API
- 💡 Useful for theming, backgrounds, gradients, and more
Add the JitPack repository in your settings.gradle file:
dependencyResolutionManagement {
repositoriesMode.set(RepositoriesMode.FAIL_ON_PROJECT_REPOS)
repositories {
mavenCentral()
maven { url 'https://www.jitpack.io' }
}
}Then add the dependency in your build.gradle (app module):
implementation 'com.github.aakashsakhalkar:AndroidColorExtractor:v1.0.0'ColorPaletteX.extractColors(
bitmap,
true, // getDominant
true, // getVibrant
true, // getMuted
true, // getAllSwatches
result -> {
Log.d("ColorPaletteX", "Dominant: " + result.dominantColor);
Log.d("ColorPaletteX", "Vibrant: " + result.vibrantColor);
Log.d("ColorPaletteX", "Muted: " + result.mutedColor);
for (String hex : result.allColors) {
Log.d("ColorPaletteX", "Swatch: " + hex);
}
}
);Dominant: #F86018
Vibrant: #F86018
Muted: #5050B0
Swatch: #202098
Swatch: #9090C8
Swatch: #181898
...
This project is MIT licensed.