colorpicker

color picker for android

Github星跟踪图

Color Picker

Android Arsenal
https://img.shields.io/github/tag/QuadFlask/colorpicker.svg?label=maven

icon

simple android color picker with color wheel and lightness bar.

market link

Demo video

Youtube

Screenshot

WHEEL_TYPE.FLOWER

screenshot3.png

WHEEL_TYPE.CIRCLE

screenshot.png

How to add dependency?

This library is not released in Maven Central, but instead you can use JitPack

add remote maven url in allprojects.repositories

allprojects {
	repositories {
		maven { url "https://jitpack.io" }
	}
}

then add a library dependency

dependencies {
	implementation 'com.github.QuadFlask:colorpicker:0.0.15'
}

or, you can manually download aar and put into your project's libs directory.

and add dependency

dependencies {
	compile(name:'[arrFileName]', ext:'aar')
}

check out latest version at releases

Usage

As a dialog

ColorPickerDialogBuilder
	.with(context)
	.setTitle("Choose color")
	.initialColor(currentBackgroundColor)
	.wheelType(ColorPickerView.WHEEL_TYPE.FLOWER)
	.density(12)
	.setOnColorSelectedListener(new OnColorSelectedListener() {
		@Override
		public void onColorSelected(int selectedColor) {
			toast("onColorSelected: 0x" + Integer.toHexString(selectedColor));
		}
	})
	.setPositiveButton("ok", new ColorPickerClickListener() {
		@Override
		public void onClick(DialogInterface dialog, int selectedColor, Integer[] allColors) {
			changeBackgroundColor(selectedColor);
		}
	})
	.setNegativeButton("cancel", new DialogInterface.OnClickListener() {
		@Override
		public void onClick(DialogInterface dialog, int which) {
		}
	})
	.build()
	.show();

As a widget

	<com.flask.colorpicker.ColorPickerView
		android:id="@+id/color_picker_view"
		android:layout_width="match_parent"
		android:layout_height="wrap_content"
		app:alphaSlider="true"
		app:density="12"
		app:lightnessSlider="true"
		app:wheelType="FLOWER"
		app:lightnessSliderView="@+id/v_lightness_slider"
	    app:alphaSliderView="@+id/v_alpha_slider"
		/>

	<com.flask.colorpicker.slider.LightnessSlider
		android:id="@+id/v_lightness_slider"
		android:layout_width="match_parent"
		android:layout_height="48dp"
		/>

	<com.flask.colorpicker.slider.AlphaSlider
		android:id="@+id/v_alpha_slider"
		android:layout_width="match_parent"
		android:layout_height="48dp"
		/>

To do

  • gradle support
  • performance improvement
  • refactoring

License

Copyright 2014-2017 QuadFlask

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.

主要指标

概览
名称与所有者QuadFlask/colorpicker
主编程语言Java
编程语言Java (语言数: 1)
平台
许可证
所有者活动
创建于2015-03-21 07:49:18
推送于2023-01-24 22:11:00
最后一次提交2020-10-01 23:43:18
发布数15
最新版本名称0.0.15 (发布于 )
第一版名称0.0.1 (发布于 )
用户参与
星数1.2k
关注者数35
派生数223
提交数198
已启用问题?
问题数104
打开的问题数46
拉请求数23
打开的拉请求数3
关闭的拉请求数5
项目设置
已启用Wiki?
已存档?
是复刻?
已锁定?
是镜像?
是私有?