EyeDropper

Additional

Language
Kotlin
Version
1.1.1 (May 30, 2017)
Created
Apr 29, 2017
Updated
Jun 20, 2017
Owner
Madrapps
Contributors
Instrap (instrap)
Henry (thsaravana)
2
Activity
Badge
Generate
Download
Source code
APK file

Advertising

EyeDropper

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

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.