Skip to content

SimpleColorDialog

Philipp Niedermayer edited this page May 28, 2021 · 5 revisions

Color palette picker

extends CustomListDialog, Full API reference

A Dialog that can be used to chose a color from a pallet. Also allows for custom colors using the ColorWheelDialog

Example

SimpleColorDialog.build()
                 .title(R.string.pick_a_color)
                 .colorPreset(color)
                 .allowCustom(true)
                 .show(this, COLOR_DIALOG);

Available customizations

  • Color pallet
    .colors(Context context, @ArrayRes int colorArrayRes)
    .colors(@ColorInt int[] colors)
    Predefined pallets:
  • MATERIAL_COLOR_PALLET (Default if unspecified)
  • MATERIAL_COLOR_PALLET_LIGHT
  • MATERIAL_COLOR_PALLET_DARK
  • BEIGE_COLOR_PALLET
  • Initial selected color
    .colorPreset(@ColorInt int color)
  • Allow custom
    .allowCustom(boolean allow)

Receiving results

The Bundle returned from this dialog will contain the following extras

@ColorInt int COLOR    // The color chosen

Clone this wiki locally