kingsollyu / Color-O-Matic

Beautiful color picker dialog for Android 9+

Geek Repo:Geek Repo

Github PK Tool:Github PK Tool

Color-O-Matic

Android Arsenal

Beautiful Color Picker dialog for Android 9+ based on VintageChroma by Pavel Sikun. Screenshots at the end of the file.

Repository

Add this in your root build.gradle file (not your module build.gradle file):

allprojects {
	repositories {
		...
		maven { url "https://jitpack.io" }
	}
}

Dependency

Add this to your module's build.gradle file (make sure the version matches the JitPack badge above):

dependencies {
	...
	compile 'com.github.kingsollyu:Color-O-Matic:1.1.7'
}

Usage

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.

Screenshots

About

Beautiful color picker dialog for Android 9+

License:GNU General Public License v3.0


Languages

Language:Java 100.0%