Color picket

1 篇文章 / 0 new
author
Color picket
幾個不錯的色彩選取介面程式 Color Picker
AmbilWarna Industrial Solutions Chiralcode HoloColorPicker

HoloColorPicker 共提供5種元件供使用 ColorPicker, SVBar, OpacityBar, SaturationBar, ValueBar. 如
<com.larswerkman.holocolorpicker.ColorPicker
    android:id="@+id/picker"
    android:layout_width="wrap_content"
    android:layout_height="wrap_content"/>
使用
ColorPicker picker = (ColorPicker) findViewById(R.id.picker);
SVBar svBar = (SVBar) findViewById(R.id.svbar);
OpacityBar opacityBar = (OpacityBar) findViewById(R.id.opacitybar);
SaturationBar saturationBar = (SaturationBar) findViewById(R.id.saturationbar);
ValueBar valueBar = (ValueBar) findViewById(R.id.valuebar);
 
picker.addSVBar(svBar);
picker.addOpacityBar(opacityBar);
picker.addSaturationBar(saturationBar);
picker.addValueBar(valueBar);
 
picker.getColor();//取得顏色
 
//To set the old selected color u can do it like this
picker.setOldCenterColor(picker.getColor());
// adds listener to the colorpicker which is implemented
//in the activity
picker.setOnColorChangedListener(this);
 
//to turn of showing the old color
picker.setShowOldCenterColor(false);
 
//adding onChangeListeners to bars
opacitybar.setOnOpacityChangeListener(new OnOpacityChangeListener &hellip;)
valuebar.setOnValueChangeListener(new OnValueChangeListener &hellip;)
saturationBar.setOnSaturationChangeListener(new OnSaturationChangeListener &hellip;)
Free Web Hosting