colorpicker

Beautiful color picker for Android

License

License

GroupId

GroupId

io.github.vadiole
ArtifactId

ArtifactId

colorpicker
Last Version

Last Version

1.0.2
Release Date

Release Date

Type

Type

aar
Description

Description

colorpicker
Beautiful color picker for Android
Project URL

Project URL

https://vadiole.github.io/colorpicker
Source Code Management

Source Code Management

https://github.com/vadiole/colorpicker/tree/master

Download colorpicker

How to add to project

<!-- https://jarcasting.com/artifacts/io.github.vadiole/colorpicker/ -->
<dependency>
    <groupId>io.github.vadiole</groupId>
    <artifactId>colorpicker</artifactId>
    <version>1.0.2</version>
    <type>aar</type>
</dependency>
// https://jarcasting.com/artifacts/io.github.vadiole/colorpicker/
implementation 'io.github.vadiole:colorpicker:1.0.2'
// https://jarcasting.com/artifacts/io.github.vadiole/colorpicker/
implementation ("io.github.vadiole:colorpicker:1.0.2")
'io.github.vadiole:colorpicker:aar:1.0.2'
<dependency org="io.github.vadiole" name="colorpicker" rev="1.0.2">
  <artifact name="colorpicker" type="aar" />
</dependency>
@Grapes(
@Grab(group='io.github.vadiole', module='colorpicker', version='1.0.2')
)
libraryDependencies += "io.github.vadiole" % "colorpicker" % "1.0.2"
[io.github.vadiole/colorpicker "1.0.2"]

Dependencies

compile (2)

Group / Artifact Type Version
androidx.core » core-ktx jar 1.3.2
androidx.appcompat » appcompat jar 1.2.0

Project Modules

There are no modules declared in this project.

maven central

Color Picker — beautiful library for Android

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

Features

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

Setup

dependencies {
    implementation 'io.github.vadiole:colorpicker:1.0.2'
}

Usage

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

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

                //  set Color Model. ARGB, RGB 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")      

License

Copyright 2021 vadiole

Licensed under the Apache License, Version 2.0 (the "License");
you may not use this file except in compliance with the License.
You may obtain a copy of the License at

    http://www.apache.org/licenses/LICENSE-2.0

Unless required by applicable law or agreed to in writing, software
distributed under the License is distributed on an "AS IS" BASIS,
WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
See the License for the specific language governing permissions and
limitations under the License.

Versions

Version
1.0.2
1.0.1
1.0.0