vadiole / colorpicker

Beautiful color picker for Android

Home Page:https://vadiole.github.io/colorpicker

Geek Repo:Geek Repo

Github PK Tool:Github PK Tool

maven central

Color Picker — beautiful library for Android

screenshot 1screenshot 2screenshot 3screenshot 4screenshot 5screenshot 6screenshot 7screenshot 8

Features

  • Simple dialog builder
  • RGB & HSV color models, with optional alpha channel
  • Dark theme support
  • Sliders with gradient background
  • Switch color models in runtime

Download

Kotlin DSL:

implementation("io.github.vadiole:colorpicker:1.0.4")

Groove:

implementation 'io.github.vadiole:colorpicker:1.0.4'

Usage

// Create dialog
val colorPicker: ColorPickerDialog = ColorPickerDialog.Builder()

    // Set initial (default) color
    .setInitialColor(currentColor)

    // Set Color Model, can be ARGB, RGB, AHSV or HSV
    .setColorModel(ColorModel.HSV)

    // Set is user be able to switch color model
    .setColorModelSwitchEnabled(true)

    // Set your localized string resource for OK button
    .setButtonOkText(android.R.string.ok)

    // Set your localized string resource for Cancel button
    .setButtonCancelText(android.R.string.cancel)

    // Callback for picked color (required)
    .onColorSelected { color: Int ->
        // Use color
    }

    // Create dialog
    .create()

// Show dialog from Activity
colorPicker.show(supportFragmentManager, "color_picker")

// Show dialog from Fragment
colorPicker.show(childFragmentManager, "color_picker")      

About

Beautiful color picker for Android

https://vadiole.github.io/colorpicker

License:Apache License 2.0


Languages

Language:Kotlin 100.0%