项目作者: Pritam307

项目描述 :
A easy to use customizable color picker library
高级语言: Java
项目地址: git://github.com/Pritam307/ColorPickerLibrary.git
创建时间: 2017-09-15T14:27:33Z
项目社区:https://github.com/Pritam307/ColorPickerLibrary

开源协议:Apache License 2.0

下载


ColorPickerLibrary

Alt text

Alt text

For Gradle:
Add it in your root build.gradle at the end of repositories:

  1. allprojects {
  2. repositories {
  3. ...
  4. maven { url 'https://jitpack.io' }
  5. }
  6. }

Add the dependency:

  1. dependencies {
  2. compile 'com.github.Pritam307:ColorPickerLibrary:master-SNAPSHOT'
  3. }

For Maven:
Add the JitPack repository to your build file:

  1. <repositories>
  2. <repository>
  3. <id>jitpack.io</id>
  4. <url>https://jitpack.io</url>
  5. </repository>
  6. </repositories>

Add the dependency:

  1. <dependency>
  2. <groupId>com.github.Pritam307</groupId>
  3. <artifactId>ColorPickerLibrary</artifactId>
  4. <version>master-SNAPSHOT</version>
  5. </dependency>

Use this in the layout.xml file:

  1. <com.pritamkundilya.colorpickerlibrary_pk.ColorPickerView
  2. android:layout_width="300dp"
  3. android:id="@+id/picker"
  4. android:layout_height="300dp"
  5. android:layout_alignParentTop="true"
  6. android:layout_centerHorizontal="true"
  7. android:layout_marginTop="35dp" ></com.pritamkundilya.colorpickerlibrary_pk.ColorPickerView>
  8. <com.pritamkundilya.colorpickerlibrary_pk.ColorAlpha
  9. android:id="@+id/alphabar"
  10. android:max="255"
  11. android:layout_width="match_parent"
  12. android:layout_height="50dp"
  13. android:layout_margin="20dp"
  14. android:layout_below="@+id/picker"
  15. android:layout_centerHorizontal="true" ></com.pritamkundilya.colorpickerlibrary_pk.ColorAlpha>

And this lines of code in activity:

  1. GetColor color;
  2. ColorPickerView view;
  3. ColorAlpha seekbar;
  4. ArrayList<Integer> val=new ArrayList<>();
  5. view= (ColorPickerView) findViewById(R.id.picker);
  6. seekbar= (ColorAlpha) findViewById(R.id.alphabar);
  7. color=new GetColor(getApplicationContext(),view,seekbar);
  8. color.extract();
  9. public void onClickColor(View v)
  10. {
  11. val=color.getRGB();
  12. Toast.makeText(getApplicationContext(), "Alpha:"+val.get(0)+"Red:"+val.get(1)+"Green:"+val.get(2)+"Blue:"+val.get(3),Toast.LENGTH_LONG).show();
  13. }
  14. ....

}

LICENSE

Copyright (C) 2017 Pritam Kundilya

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.