Skip to content

Commit

Permalink
Update index.md
Browse files Browse the repository at this point in the history
  • Loading branch information
vadiole authored Dec 19, 2022
1 parent 0258883 commit 565b6aa
Showing 1 changed file with 37 additions and 32 deletions.
69 changes: 37 additions & 32 deletions index.md
Original file line number Diff line number Diff line change
@@ -1,58 +1,63 @@
# Color Picker — beautiful library for Android

[![maven central](https://img.shields.io/maven-central/v/io.github.vadiole/colorpicker?color=236dc22&labelColor=424242)](https://search.maven.org/artifact/io.github.vadiole/colorpicker/1.0.2/aar)[![github](https://shields.io/badge/github-black?logo=github&labelColor=24282e&color=24282e&logoColor=white)](https://github.com/vadiole/colorpicker)
[![maven central](https://img.shields.io/maven-central/v/io.github.vadiole/colorpicker?color=236dc22&labelColor=424242)](https://search.maven.org/artifact/io.github.vadiole/colorpicker/1.0.3/aar)[![github](https://shields.io/badge/github-black?logo=github&labelColor=24282e&color=24282e&logoColor=white)](https://github.com/vadiole/colorpicker)

<img src="https://raw.githubusercontent.com/vadiole/colorpicker/master/assets/1_l.png" alt="screenshot 1" width="25%" height="25%"><img src="https://raw.githubusercontent.com/vadiole/colorpicker/master/assets/2_l.png" alt="screenshot 2" width="25%" height="25%"><img src="https://raw.githubusercontent.com/vadiole/colorpicker/master/assets/1_d.png" alt="screenshot 3" width="25%" height="25%"><img src="https://raw.githubusercontent.com/vadiole/colorpicker/master/assets/2_d.png" alt="screenshot 4" width="25%" height="25%"><img src="https://raw.githubusercontent.com/vadiole/colorpicker/master/assets/3_l.png" alt="screenshot 5" width="25%" height="25%"><img src="https://raw.githubusercontent.com/vadiole/colorpicker/master/assets/4_l.png" alt="screenshot 6" width="25%" height="25%"><img src="https://raw.githubusercontent.com/vadiole/colorpicker/master/assets/3_d.png" alt="screenshot 7" width="25%" height="25%"><img src="https://raw.githubusercontent.com/vadiole/colorpicker/master/assets/4_d.png" alt="screenshot 8" width="25%" height="25%">

### Features
- Simple dialog builder
- ARGB, RGB & HSV color models
- Dark theme support
- Sliders with gradient background
- Switch color models in runtime

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

### Setup
### Download

Kotlin DSL:
```kotlin
implementation("io.github.vadiole:colorpicker:1.0.3")
```

Groove:
```gradle
dependencies {
implementation 'io.github.vadiole:colorpicker:1.0.2'
}
implementation 'io.github.vadiole:colorpicker:1.0.3'
```

### Usage

```kotlin

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

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

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

// set Color Model. ARGB, RGB or HSV
.setColorModel(ColorModel.HSV)
// Set is user be able to switch color model
.setColorModelSwitchEnabled(true)

// 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 OK button
.setButtonOkText(android.R.string.ok)
// Set your localized string resource for Cancel button
.setButtonCancelText(android.R.string.cancel)

// set your localized string resource for Cancel button
.setButtonCancelText(android.R.string.cancel)
// Callback for picked color (required)
.onColorSelected { color: Int ->
// Use color
}

// callback for picked color (required)
.onColorSelected { color: Int ->
// use color
}
// Create dialog
.create()

// create dialog
.create()


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

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

Expand Down

0 comments on commit 565b6aa

Please sign in to comment.