Step 1. Add the JitPack repository to your build file
Add it in your root settings.gradle at the end of repositories:
dependencyResolutionManagement {
repositoriesMode.set(RepositoriesMode.FAIL_ON_PROJECT_REPOS)
repositories {
mavenCentral()
maven { url 'https://jitpack.io' }
}
}
Add it in your settings.gradle.kts at the end of repositories:
dependencyResolutionManagement {
repositoriesMode.set(RepositoriesMode.FAIL_ON_PROJECT_REPOS)
repositories {
mavenCentral()
maven { url = uri("https://jitpack.io") }
}
}
Add to pom.xml
<repositories>
<repository>
<id>jitpack.io</id>
<url>https://jitpack.io</url>
</repository>
</repositories>
Add it in your build.sbt at the end of resolvers:
resolvers += "jitpack" at "https://jitpack.io"
Add it in your project.clj at the end of repositories:
:repositories [["jitpack" "https://jitpack.io"]]
Step 2. Add the dependency
dependencies {
implementation 'com.github.madrapps:pikolo:2.0.1'
}
dependencies {
implementation("com.github.madrapps:pikolo:2.0.1")
}
<dependency>
<groupId>com.github.madrapps</groupId>
<artifactId>pikolo</artifactId>
<version>2.0.1</version>
</dependency>
libraryDependencies += "com.github.madrapps" % "pikolo" % "2.0.1"
:dependencies [[com.github.madrapps/pikolo "2.0.1"]]
An android color picker library
<img src="/preview/arc-selectors.gif" alt="preview" title="preview" width="200" height="200"/><img src="/preview/preview-full.gif" alt="preview" title="preview" width="200" height="200"/><img src="/preview/rgb-picker.gif" alt="preview" title="preview" width="200" height="200"/>
repositories {
mavenCentral()
}
dependencies {
implementation 'com.github.madrapps:pikolo:2.0.2'
}
HSLColorPicker and RGBColorPickerAdd the HSLColorPicker or RGBColorPicker view to your layout and use it in code as below:
final ColorPicker colorPicker = findViewById(R.id.colorPicker);
colorPicker.setColorSelectionListener(new SimpleColorSelectionListener() {
@Override
public void onColorSelected(int color) {
// Do whatever you want with the color
imageView.getBackground().setColorFilter(color, PorterDuff.Mode.MULTIPLY);
}
});
You can take a look at the sample app to see how
the color picker can be customised. There are 3 components in both pickers. You can change their properties
together or individually. For instance, arc_length changes the length of the arc for all 3 components, while
hue_arc_length affects only the Hue component. Various other XML attributes are as follows:<br>
arc_width - width (thickness) of the components<br>
arc_length - length of the components<br>
stroke_width - width of the stroke of the components<br>
stroke_color - stroke color of the components<br>
indicator_radius - radius of the control indicator used to change color<br>
indicator_stroke_width - stroke width of indicator<br>
indicator_stroke_color - stroke color of indicator<br>
radius_offset - the offset of the components from the center of the picker<br>
Pikolo by Madrapps is licensed under a Apache License 2.0.