Ecosyste.ms: Awesome
An open API service indexing awesome lists of open source software.
https://github.com/yukuku/ambilwarna
Android Color Picker aka AmbilWarna library ("Pick a Color" in Indonesian)
https://github.com/yukuku/ambilwarna
Last synced: about 1 month ago
JSON representation
Android Color Picker aka AmbilWarna library ("Pick a Color" in Indonesian)
- Host: GitHub
- URL: https://github.com/yukuku/ambilwarna
- Owner: yukuku
- License: other
- Created: 2015-01-12T15:44:50.000Z (almost 10 years ago)
- Default Branch: master
- Last Pushed: 2024-04-21T01:23:25.000Z (8 months ago)
- Last Synced: 2024-10-03T16:04:30.287Z (2 months ago)
- Language: Java
- Size: 140 KB
- Stars: 221
- Watchers: 21
- Forks: 88
- Open Issues: 15
-
Metadata Files:
- Readme: README.md
- License: LICENSE
Awesome Lists containing this project
- awesome-indo-projects - Android Color Picker - To customize the color of some background, text, or maybe for a painting application. (Android)
- awesome-indonesia-repo - Android Color Picker - To customize the color of some background, text, or maybe for a painting application. (Android)
README
![logo](./Ambilwarna-logotype4.png)
Android Color Picker
====================[![Maven Central](https://maven-badges.herokuapp.com/maven-central/com.github.yukuku/ambilwarna/badge.svg)](https://maven-badges.herokuapp.com/maven-central/com.github.yukuku/ambilwarna)
aka `AmbilWarna` library ("Pick a Color" in Indonesian)
moved from http://code.google.com/p/yuku-android-util/
This is a small library for your application to enable the users to select an arbitrary color. It is used in the free Bible applications for Android (http://www.bibleforandroid.com).
It is also used by:
* 1,000,000+ downloads app DigiClock Widget
* 100,000+ downloads app Banner
* 10,000+ downloads app MementoIf your application has a feature to customize the color of some background, text, or maybe for a painting application where the user can select different colors for painting or filling, then `AmbilWarna` is suitable for you.
Adding it to your project
===========Android Studio 3.0 and above:
```groovy
dependencies {
implementation 'com.github.yukuku:ambilwarna:2.0.1'
}
```Android Studio 2.3.* and lower:
```groovy
dependencies {
compile 'com.github.yukuku:ambilwarna:2.0.1'
}
```Screenshots
===========How to use the dialog
=====================Create a color picker dialog by calling the following constructor, and then show it.
AmbilWarnaDialog(Context context, int color, OnAmbilWarnaListener listener)
Alpha is also supported by passing the 3rd parameter `supportsAlpha`:
AmbilWarnaDialog(Context context, int color, boolean supportsAlpha, OnAmbilWarnaListener listener)
Example:
// initialColor is the initially-selected color to be shown in the rectangle on the left of the arrow.
// for example, 0xff000000 is black, 0xff0000ff is blue. Please be aware of the initial 0xff which is the alpha.
AmbilWarnaDialog dialog = new AmbilWarnaDialog(this, initialColor, new OnAmbilWarnaListener() {
@Override
public void onOk(AmbilWarnaDialog dialog, int color) {
// color is the color selected by the user.
}
@Override
public void onCancel(AmbilWarnaDialog dialog) {
// cancel was selected by the user
}dialog.show();
How to use it as a Preference
=============================![](http://s11.postimg.org/sfn41uh43/img.png)
Very simple. It works like a `DialogPreference` that stores an Integer to the shared preferences file.
Just add the following to the preferences xml file.
To enable alpha, use the application attribute `supportsAlpha`, as follows:
Contributors
============* Pascal Cans (noobs.com)
* Justin Warner (One Rainboot Studio)
* Logo design by [anaufalm](https://github.com/anaufalm)