{"id":26497533,"url":"https://github.com/duanhong169/colorpicker","last_synced_at":"2025-04-04T21:07:42.926Z","repository":{"id":37271144,"uuid":"141013615","full_name":"duanhong169/ColorPicker","owner":"duanhong169","description":"🎨 A color picker for Android. Pick a color using color wheel and slider (HSV \u0026 alpha). ","archived":false,"fork":false,"pushed_at":"2019-01-16T07:56:42.000Z","size":7350,"stargazers_count":379,"open_issues_count":13,"forks_count":86,"subscribers_count":11,"default_branch":"master","last_synced_at":"2025-03-28T20:07:10.597Z","etag":null,"topics":["android-view","color-picker","color-picker-popup","color-wheel","hsv"],"latest_commit_sha":null,"homepage":"","language":"Java","has_issues":true,"has_wiki":null,"has_pages":null,"mirror_url":null,"source_name":null,"license":"apache-2.0","status":null,"scm":"git","pull_requests_enabled":true,"icon_url":"https://github.com/duanhong169.png","metadata":{"files":{"readme":"README.md","changelog":null,"contributing":null,"funding":null,"license":"LICENSE","code_of_conduct":null,"threat_model":null,"audit":null,"citation":null,"codeowners":null,"security":null,"support":null}},"created_at":"2018-07-15T09:16:04.000Z","updated_at":"2025-01-13T09:09:51.000Z","dependencies_parsed_at":"2022-08-10T03:11:04.315Z","dependency_job_id":null,"html_url":"https://github.com/duanhong169/ColorPicker","commit_stats":null,"previous_names":[],"tags_count":11,"template":false,"template_full_name":null,"repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/duanhong169%2FColorPicker","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/duanhong169%2FColorPicker/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/duanhong169%2FColorPicker/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/duanhong169%2FColorPicker/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/duanhong169","download_url":"https://codeload.github.com/duanhong169/ColorPicker/tar.gz/refs/heads/master","host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":247249524,"owners_count":20908212,"icon_url":"https://github.com/github.png","version":null,"created_at":"2022-05-30T11:31:42.601Z","updated_at":"2022-07-04T15:15:14.044Z","host_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub","repositories_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories","repository_names_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repository_names","owners_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners"}},"keywords":["android-view","color-picker","color-picker-popup","color-wheel","hsv"],"created_at":"2025-03-20T13:43:07.661Z","updated_at":"2025-04-04T21:07:42.905Z","avatar_url":"https://github.com/duanhong169.png","language":"Java","funding_links":[],"categories":[],"sub_categories":[],"readme":"# ColorPicker [![gitHub release](https://img.shields.io/github/release/duanhong169/ColorPicker.svg?style=social)](https://github.com/duanhong169/ColorPicker/releases) [![platform](https://img.shields.io/badge/platform-android-brightgreen.svg)](https://developer.android.com/index.html) [![Android Arsenal](https://img.shields.io/badge/Android%20Arsenal-ColorPicker-green.svg?style=flat)](https://android-arsenal.com/details/1/7068) \u003ca target=\"_blank\" href=\"https://android-arsenal.com/api?level=14\"\u003e\u003cimg src=\"https://img.shields.io/badge/API-14%2B-brightgreen.svg?style=flat\"\u003e\u003c/a\u003e [![license](https://img.shields.io/badge/license-Apache%202-green.svg)](https://github.com/duanhong169/ColorPicker/blob/master/LICENSE)\n\nEnglish | [中文](README_cn.md)\n\nA `ColorPicker` for Android. Pick a color using color wheel and slider (HSV \u0026 alpha).\n\n\u003cimg src='art/screen-shot-1.png' width='32%'/\u003e \u003cimg src='art/screen-shot-2.png' width='32%'/\u003e \u003cimg src='art/screen-record.gif' width='32%'/\u003e\n\n## Gradle\n\n```\ndependencies {\n    implementation 'com.github.duanhong169:colorpicker:${latestVersion}'\n    ...\n}\n```\n\n\u003e Replace `${latestVersion}` with the latest version code. See [releases](https://github.com/duanhong169/ColorPicker/releases).\n\n## Usage\n\n### Using `ColorPickerPopup`\n\n```java\nnew ColorPickerPopup.Builder(this)\n        .initialColor(Color.RED) // Set initial color\n        .enableBrightness(true) // Enable brightness slider or not\n        .enableAlpha(true) // Enable alpha slider or not\n        .okTitle(\"Choose\")\n        .cancelTitle(\"Cancel\")\n        .showIndicator(true)\n        .showValue(true)\n        .build()\n        .show(v, new ColorPickerPopup.ColorPickerObserver() {\n            @Override\n            public void onColorPicked(int color) {\n                v.setBackgroundColor(color);\n            }\n\n            @Override\n            public void onColor(int color, boolean fromUser) {\n\n            }\n        });\n```\n\n### Using `ColorPickerView`\n\n* Add `ColorPickerView` into your layout xml:\n\n```xml\n\u003ctop.defaults.colorpicker.ColorPickerView\n    android:id=\"@+id/colorPicker\"\n    android:layout_width=\"0dp\"\n    android:layout_height=\"wrap_content\"\n    app:enableBrightness=\"true\"\n    app:enableAlpha=\"true\"\n    app:layout_constraintLeft_toLeftOf=\"parent\"\n    app:layout_constraintRight_toRightOf=\"parent\"\n    app:layout_constraintTop_toTopOf=\"parent\"/\u003e\n```\n\n\u003e See [`top_defaults_view_color_picker_attrs.xml`](./colorpicker/src/main/res/values/top_defaults_view_color_picker_attrs.xml) for all supported attributes.\n\n* Implement `ColorObserver` and subscribe to `ColorPickerView` to receive color updates from the `ColorPickerView`:\n\n```java\ncolorPickerView.subscribe((color, fromUser) -\u003e {\n    // use the color\n});\n```\n\n* Set initial color:\n\n```java\ncolorPickerView.setInitialColor(0x7F313C93);\n```\n\n* Reset to initial color:\n\n```java\ncolorPickerView.reset();\n```\n\nSee a complete usage in the app sample code.\n\n## License\n\n    Copyright 2018 Hong Duan\n\n    Licensed under the Apache License, Version 2.0 (the \"License\");\n    you may not use this file except in compliance with the License.\n    You may obtain a copy of the License at\n\n        http://www.apache.org/licenses/LICENSE-2.0\n\n    Unless required by applicable law or agreed to in writing, software\n    distributed under the License is distributed on an \"AS IS\" BASIS,\n    WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n    See the License for the specific language governing permissions and\n    limitations under the License.","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fduanhong169%2Fcolorpicker","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fduanhong169%2Fcolorpicker","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fduanhong169%2Fcolorpicker/lists"}