Skip to content

Latest commit

 

History

History
84 lines (63 loc) · 3.03 KB

README.md

File metadata and controls

84 lines (63 loc) · 3.03 KB

ColorPicker

Color picker view library provides selection of a color via human-perceivable form HSB using three selectors: hue, saturation and brightness. The code is very simple and small (on August 2020).

Library icon

Concept and screenshots

Concept of color picker dialog with some hints:

  • Initial and current colors are placed side-by-side, so the difference can be clearly visible
  • Numbers behind each component provide the ability to "recreate" the color later
  • No puzzles which color you get with HSB model

Color picker dialog concept

Live screenshots:

Dark theme Light theme with transparency
Screenshot dark theme Screenshot light theme with transparency

Action demo:

Slider stripes and manipulator dots adapt their color on moving other sliders.

Color picker dialog concept

Add color picker to your project

Add it in your root build.gradle at the end of repositories:

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

Step 2. Add the dependency

	dependencies {
	        implementation 'com.github.applikationsprogramvara:ColorPicker:1.0.1'
	}

Usage

Color picker is ready to use out of the box with several lines added to your code.

As a dialog:

    new ColorPickerDialog(this)
            .setTitle("Color picker dialog")
            .setInitialParameters( initalColor, false)
            .setPositiveButton("OK", color -> {
                // process the new color
            })
            .setNegativeButton("Cancel", null)
            .show();

As a view in XML:

    <com.applikationsprogramvara.colorpicker.ColorPickerSlidersView
        android:layout_width="match_parent"
        android:layout_height="wrap_content"
        app:transparency="false"
        app:initialColor="#9B3232"
        />

Things to do

  • Manupulator theming and contrast on low brightness
  • Alternative one-tap palette with all possible colors
  • Landscape mode
  • Digital input and copy/paste HTML-colors
  • Preference
  • Get rid of jumping color patches due to extra digit