Android 颜色选择器 ColorPicker
- 授权协议: Apache
- 开发语言: Java
- 操作系统: Android
- 软件首页: https://github.com/duanhong169/ColorPicker
- 软件文档: https://github.com/duanhong169/ColorPicker
- 官方下载: https://github.com/duanhong169/ColorPicker
软件介绍
ColorPicker
一款标准的Android颜色选择器,使用HSV和透明度选择颜色。
Gradle
dependencies {
implementation 'com.github.duanhong169:colorpicker:${latestVersion}'
...
}${latestVersion}请替换为当前最新版本号,见 releases.
Usage
使用 ColorPickerPopup
new ColorPickerPopup.Builder(this)
.initialColor(Color.RED) // Set initial color
.enableAlpha(true) // Enable alpha slider or not
.okTitle("Choose")
.cancelTitle("Cancel")
.showIndicator(true)
.showValue(true)
.build()
.show(v, new ColorPickerPopup.ColorPickerObserver() {
@Override
public void onColorPicked(int color) {
v.setBackgroundColor(color);
}
@Override
public void onColor(int color, boolean fromUser) {
}
});使用 ColorPickerView
将 ColorPickerView 添加到 layout xml :
<top.defaults.view.ColorPickerView android:id="@+id/colorPicker" android:layout_width="0dp" android:layout_height="wrap_content" app:enableAlpha="true" app:layout_constraintLeft_toLeftOf="parent" app:layout_constraintRight_toRightOf="parent" app:layout_constraintTop_toTopOf="parent"/>
查阅
top_defaults_view_color_picker_attrs.xml了解所有支持的属性。
执行
ColorObserver并订阅ColorPickerView以从ColorPickerView接收颜色更新:
colorPickerView.subscribe((color, fromUser) -> {
// use the color
});设置初始颜色:
colorPickerView.setInitialColor(0x7F313C93);
重置初始颜色:
colorPickerView.reset();
更详细的使用方法请参见示例。
The Little Prover
Daniel P. Friedman、Carl Eastlund / The MIT Press / 2015-7-10 / USD 38.00
[FROM www.amazon.com]: The Little Prover introduces inductive proofs as a way to determine facts about computer programs. It is written in an approachable, engaging style of question-and-answer, wi......一起来看看 《The Little Prover》 这本书的介绍吧!
