ColorPickerView for Android Image Color Selection
🎨 Android colorpicker for getting colors from any images by tapping on the desired color.
At a glance
- What is it?
- ColorPickerView is an Apache-2.0 Android library for selecting HSV, ARGB, and Hex colors from images with a tap. It fits View-based Android apps, while Compose developers are directed to colorpicker-compose.
- Who is it for?
- ColorPickerView suits Android teams building View-based image editing, annotation, theming, or color inspection interfaces that need direct access to HSV, ARGB, and Hex values. It is not the documented choice for Compose projects, and it does not claim automatic extraction of a complete dominant-color palette.
- Can I use it commercially?
- Yes. Apache-2.0 is a permissive licence: you can use, modify and sell software built on it, as long as you keep its copyright and licence notices.
- Is it still maintained?
- Yes. The repository last received commits 9 days ago.
- What is it written in?
- Mainly Java, according to GitHub's language statistics.
Answers come from the project's GitHub data, last synced on October 20, 2026, and from our analysis. They are not legal advice.
Editorial analysis
Where ColorPickerView Fits in an Android App
ColorPickerView solves a specific UI problem: allowing an Android user to choose a color by touching an image rather than entering a numeric value or matching colors from predefined swatches. It is aimed at developers creating View-based Android interfaces where users inspect an image, select a visible point, and use that color elsewhere in the application. The selection can be consumed as HSV information, an ARGB integer array, a Hex string, or the standard integer color representation.
The library goes beyond a basic touch listener. Its documented feature set includes custom palette images, a movable selector, alpha and brightness slider bars, a dialog, an optional flag view, state restoration, and debouncing for listener callbacks. That makes it relevant to image annotation, photo editing, theme selection, paint configuration, and other interfaces where image color matters.
This is an Android View library rather than a general image-processing service. It selects a color at an interaction point, but the README does not claim automatic extraction of a complete dominant-color palette, color naming, image editing, or color correction. Those are separate problems. Its scope is interaction and color-value delivery within an Android interface.
The repository is not archived, and the last push was on 2026-10-14. The release history also includes version 2.5.0 from 2026-09-16, following version 2.4.0 from 2026-01-10. These dates confirm recent repository and release activity, although the README does not define a long-term support window or a compatibility policy for older releases.
Palette Images, Touch Coordinates, and ColorEnvelope
A ColorPickerView instance is backed by a palette. When no custom palette is configured, the documented default is `ColorHsvPalette`, which presents an HSV color surface. The selector moves to a selected point, and the library translates that selection into color values delivered through a listener. The visible palette can also be supplied from a bitmap drawable, which permits an application to present an image or custom color layout as the selection surface.
The basic `ColorListener` receives an integer color and a `fromUser` Boolean. This form is sufficient when the application only needs a standard Android color value, for example when assigning that color to a view background. The documented callback signature is:
colorPickerView.setColorListener(new ColorListener() {
@Override
public void onColorSelected(int color, boolean fromUser) {
LinearLayout linearLayout = findViewById(R.id.linearLayout);
linearLayout.setBackgroundColor(color);
}
});When several representations are needed, `ColorEnvelopeListener` supplies a `ColorEnvelope`. Its documented accessors expose `getColor()`, `getHexCode()`, and `getArgb()`. This avoids forcing the application to choose one representation before selection. The listener is invoked after a tap or when a position is selected through a method.
The palette type still matters. The README states that setting an initial selector color from an `initialColor` attribute works only with the default HSV palette, and that `zoomEnabled` works only with a bitmap palette. Applications should therefore treat palette choice as part of the API contract rather than as a purely visual customization.
Adding ColorPickerView and Handling the First Selection
The documented installation is a Gradle dependency in the application module's `build.gradle` file. Add the published version shown by the README to the module dependency block:
dependencies {
implementation("com.github.skydoves:colorpickerview:2.5.0")
}After Gradle resolves the library, the View can be declared in an XML layout. The fully qualified class is `com.skydoves.colorpickerview.ColorPickerView`. The README example uses a fixed `300dp` square and gives the view an `android:id` so application code can locate it. That example initializes the default HSV palette and selector without additional configuration.
For applications that use XML attributes, the layout file also needs this namespace:
xmlns:app="http://schemas.android.com/apk/res-auto"The namespace is needed only for the documented `app:` attributes such as `app:palette`, `app:selector`, and `app:debounceDuration`. Once the view is present, register the listener appropriate to the data the application needs. Use `ColorListener` for an integer color or `ColorEnvelopeListener` when the interface also needs Hex or ARGB access.
The first integration check is direct: add the dependency, instantiate the View, attach one listener, and confirm that touching a known palette position produces the expected color. The README does not document an emulator setup procedure, minimum Android Studio version, or special repository configuration, so none should be assumed.
Customization, Debounce, and Picker State
ColorPickerView allows several visual and behavioral settings through XML attributes. `app:palette` sets a custom palette image, while `app:selector` sets a custom selector drawable. `app:selector_size` changes the selector's width and height, and `app:alpha_selector` controls its alpha. `app:alpha_flag` controls the flag alpha. `app:actionMode` accepts `always` or `last`, which affects when the selected position is acted upon according to the library's documented mode setting.
The `app:debounceDuration` attribute controls the debounce duration for invoking the color listener. This matters for interactive use because a listener may update application state whenever a selection occurs. The README does not explain the exact event timing or every numeric edge case, but it identifies debounce as a built-in mechanism rather than something the consumer must add outside the view.
Pinch zoom is available through `app:zoomEnabled="true"`, with `app:maxZoom` setting the maximum scale. The README limits this behavior to a bitmap palette. An application using a custom bitmap needs interaction testing because zoom changes the relationship between touch position and palette sampling. By contrast, an application retaining `ColorHsvPalette` can use `app:initialColor` to position the selector from a color resource.
State handling is also part of the documented API. The repository's table of contents includes restore and save functionality, and the introduction states that selected data can be saved and restored. The README excerpt does not show the exact save and restore calls, so an integrator should consult the linked documentation for the complete state contract before depending on a particular persistence mechanism.
Sliders, Dialogs, and Gallery Palettes
Beyond the main selection surface, the project documents `AlphaSlideBar`, `BrightnessSlideBar`, `ColorPickerDialog`, `FlagView`, and `AlphaTileView` as related components or methods. Alpha changes the transparency represented by a selected color, while brightness changes its perceived lightness. These controls are separate from the image tap itself and allow an application to refine the value returned by the picker.
The project also has a gallery-palette workflow. Its documentation identifies this as "Palette from Gallery," and the homepage is `https://skydoves.github.io/ColorPickerView/`. The README excerpt does not show the full implementation, permissions, intent contract, decoding path, or lifecycle handling for that workflow. Those details should come from the linked documentation rather than being inferred from the component name.
For applications that need a modal editing flow, `ColorPickerDialog` is the documented choice. The README does not state whether every slider and flag feature is automatically included in the dialog, so treating the dialog as an identical copy of a custom XML layout would go beyond the documented behavior. The practical distinction is architectural: `ColorPickerView` is the selectable surface, the slide bars edit color components, and the dialog provides a container for a picker flow.
A Compose application should not choose this repository solely because color-picker functionality is needed. The README explicitly directs Compose users to `colorpicker-compose`. That separate project is the documented alternative for a Compose UI stack.
Android Platform, Compose, and Release Boundaries
ColorPickerView targets Android API 21 and newer, as indicated by the README badge. This is a concrete deployment constraint for applications that still support older Android versions. It is implemented primarily in Java, so an existing View-based Java or mixed-language Android application can consume the dependency through its XML and Java APIs. The README provides Java examples, so Java is the documented basis for its integration examples.
The clearest alternative approach is `colorpicker-compose`. The README does not compare its internal implementation or feature matrix, but it states that Compose projects should use that project instead. The practical difference is the Android UI architecture: this repository documents XML Views, Java listeners, drawable palettes, and Android View methods, while the recommended alternative is packaged for Compose. An application already written with Compose should resolve that framework boundary rather than adding a View-based picker to a Compose architecture.
Upgrade work is tied to published versions rather than an undocumented migration service. Version 2.5.0 is the version named in the Gradle example. The release list shows releases at 2.3.0, 2.4.0, and 2.5.0, but the README does not provide breaking-change notes or a compatibility matrix between them. Teams should check the project documentation for each version before changing the dependency.
The Apache-2.0 license permits use, distribution, and modification under its terms. The repository does not describe additional obligations specific to ColorPickerView. Applications remain responsible for reviewing and complying with the license text.
Editorial conclusion
ColorPickerView suits Android teams building View-based image editing, annotation, theming, or color inspection interfaces that need direct access to HSV, ARGB, and Hex values. It is not the documented choice for Compose projects, and it does not claim automatic extraction of a complete dominant-color palette. Before adoption, verify the API 21+ requirement, confirm that the required palette and selector assets match the product design, and check the exact save-and-restore calls in the project documentation.
Frequently asked questions
How do I install ColorPickerView in an Android project?
Add `com.github.skydoves:colorpickerview:2.5.0` as an implementation dependency in the module's `build.gradle` file. The README documents this as the Gradle installation method.
How does ColorPickerView return the selected color?
Use `ColorListener` to receive an integer color, or `ColorEnvelopeListener` to receive a `ColorEnvelope`. The envelope exposes `getColor()`, `getHexCode()`, and `getArgb()`.
Does ColorPickerView support Jetpack Compose?
The README directs developers implementing a color picker in a Compose project to `colorpicker-compose` instead. This repository documents XML Views and Java-based Android APIs.
Official sources
Add this badge to your README
If you maintain this project, the badge below links readers to this analysis and shows its maintenance status from the daily GitHub snapshot. Paste the markdown into your README; add ?metric=license or ?metric=stars to the image URL for a different field.
[](https://hysenlabs.com/projects/skydoves-colorpickerview)Was this useful?