Beautiful Color Picker dialog for Android 9+ based on VintageChroma by Pavel Sikun. Screenshots at the end of the file.
Add this in your root build.gradle
file (not your module build.gradle
file):
allprojects {
repositories {
...
maven { url "https://jitpack.io" }
}
}
Add this to your module's build.gradle
file (make sure the version matches the JitPack badge above):
dependencies {
...
compile 'com.github.GrenderG:Color-O-Matic:1.1.5'
}
To display a color picker DialogFragment
:
new ColorOMaticDialog.Builder()
.initialColor(Color.WHITE)
.colorMode(ColorMode.ARGB) // RGB, ARGB, HVS
.indicatorMode(IndicatorMode.HEX) // HEX or DECIMAL; Note that using HSV with IndicatorMode.HEX is not recommended
.onColorSelected(new OnColorSelectedListener() {
@Override
public void onColorSelected(@ColorInt int i) {
// do your stuff
}
})
.showColorIndicator(true) // Default false, choose to show text indicator showing the current color in HEX or DEC (see images) or not
.create()
.show(getSupportFragmentManager(), "ColorOMaticDialog");
See sample project for more info.