Skip to content
rumburake edited this page Dec 5, 2016 · 12 revisions

Android Color Select Dialog (HSV palette)

Overview

This is an Android library you can use in your apps to provide the users with a color choice. Hope you will have fun using it.

ScreenShots

  • Portrait:
  • Ladscape:

Features

  • HSV palette
  • orientations
    • portrait
    • landscape
  • screen sizes
    • small, medium (1x)
    • large (2x)
    • xlarge/tablets (3x)
  • strings (localization) free

Instructions

  • In your Android Studio project root, add the library from git as a submodule. The address is https://github.com/rumburake/colorselect and it should result in a module called colorselect.
  • Implement the callback for when user chose a color:
    public class ThreeCatsColorLantern extends AppCompatActivity implements ColorSelector.ColorSelectedListener {    
	@Override
	public void onNewColor(int color) {
             // do something with the new color
        }
    }
  • Create and show the color selection dialog:
    ColorSelector colorSelector = ColorSelector.newInstance(color);
    colorSelector.show(getSupportFragmentManager(), "colorSelect");

Demo

  • Checkout this project and build it. It does use the library as a submodule.
  • You can find another demo on the market: "3Cats Color Lantern" [https://market.android.com/details?id=com.ThreeCats.ColorLantern] or on GitHub: [https://github.com/rumburake/ColorLantern/]

Thanks

Goes to Yuku for his "Ambil Warna" (android-color-picker) dialog library. I used it in my apps and as a learning example. Good stuff!

Clone this wiki locally