Skip to content

Latest commit

 

History

History
41 lines (31 loc) · 1.32 KB

README.md

File metadata and controls

41 lines (31 loc) · 1.32 KB

EyeDropper

Build Status Download

An android library to pick colors from any image loaded in an ImageView or anything drawn on a Custom View

preview

Download

repositories {
  jcenter() // or mavenCentral()
}

dependencies {
  compile 'com.github.madrapps:eyedropper:1.1.0'
}

Usage

To pick color from any view (ImageView or Custom View) in your layout add the following to your code:

final View targetView = findViewById(R.id.targerView); // Any view from which you want to pick color
new EyeDropper(targetView, new ColorSelectionListener() {
  @Override
  public void onColorSelected(@ColorInt int color) {
    // color is the color selected when you touch the targetView
    (findViewById(R.id.colorSlot)).setBackgroundColor(color);
  }
});

License

EyeDropper by Madrapps is licensed under a Apache License 2.0.