Home

Awesome

🎨Color Picker Library for Android

Releases API Language PRWelcome Twitter

<div align="center"> <sub>Built with ❤︎ by <a href="https://twitter.com/Dhaval2404">Dhaval Patel</a> and <a href="https://github.com/dhaval2404/colorpicker/graphs/contributors"> contributors </a> </div> <br/>

Yet another Color Picker Library for Android. It is highly customizable and easy to use. Pick the color from wheel or select Material Colors from dialog. The original ColorPickerView was written by Hong Duan.

🐱‍🏍Features:

🎬Preview

Color PickerMaterial Color Picker

💻Usage

  1. Gradle dependency:

    allprojects {
        repositories {
            ...
            maven { url 'https://jitpack.io' }
        }
    }
    
    implementation 'com.github.Dhaval2404:ColorPicker:2.3'
    
  2. The ColorPicker configuration is created using the builder pattern.

    // Kotlin Code
    ColorPickerDialog
        .Builder(this)        				// Pass Activity Instance
        .setTitle("Pick Theme")           	// Default "Choose Color"
        .setColorShape(ColorShape.SQAURE)   // Default ColorShape.CIRCLE
        .setDefaultColor(mDefaultColor)     // Pass Default Color
        .setColorListener { color, colorHex ->
        	// Handle Color Selection
        }
        .show()
    
    // Java Code
    new ColorPickerDialog
        .Builder(this)
        .setTitle("Pick Theme")
        .setColorShape(ColorShape.SQAURE)
        .setDefaultColor(mDefaultColor)
        .setColorListener(new ColorListener() {
            @Override
            public void onColorSelected(int color, @NotNull String colorHex) {
                // Handle Color Selection
            }
        })
        .show();
    
  3. The MaterialColorPicker configuration is created using the builder pattern.

    // Kotlin Code
    MaterialColorPickerDialog
        .Builder(this)        					// Pass Activity Instance
        .setTitle("Pick Theme")           		// Default "Choose Color"
        .setColorShape(ColorShape.SQAURE)   	// Default ColorShape.CIRCLE
        .setColorSwatch(ColorSwatch._300)   	// Default ColorSwatch._500
        .setDefaultColor(mDefaultColor) 		// Pass Default Color
        .setColorListener { color, colorHex ->
       		// Handle Color Selection
        }
        .show()
    
    // Java Code
    new MaterialColorPickerDialog
        .Builder(this)
        .setTitle("Pick Theme")
        .setColorShape(ColorShape.SQAURE)
        .setColorSwatch(ColorSwatch._300)
        .setDefaultColor(mDefaultColor)
        .setColorListener(new ColorListener() {
            @Override
            public void onColorSelected(int color, @NotNull String colorHex) {
            	// Handle Color Selection
            }
        })
        .show();
    

🎨Customization

💥Compatibility

✔️Changelog

Version: 2.2/2.3

Version: 2.1

Version: 2.0

Version: 1.2

Version: 1.1

Version: 1.0

📃 Libraries Used

🌟 Credits

Let us know!

We'll be really happy if you sent us links to your projects where you use our component. Just send an email to dhavalpatel244@gmail.com And do let us know if you have any questions or suggestion regarding the library.

License

Copyright 2020-2021, Dhaval Patel

Licensed under the Apache License, Version 2.0 (the "License");
you may not use this file except in compliance with the License.
You may obtain a copy of the License at

     http://www.apache.org/licenses/LICENSE-2.0

Unless required by applicable law or agreed to in writing, software
distributed under the License is distributed on an "AS IS" BASIS,
WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
See the License for the specific language governing permissions and
limitations under the License.