EyeDropper

Additional

Language
Kotlin
Version
1.1.3 (May 23, 2019)
Created
Apr 29, 2017
Updated
May 23, 2019 (Retired)
Owner
Madrapps
Contributors
Instrap (instrap)
Saravana (thsaravana)
2
Activity
Badge
Generate
Download
Source code

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.