Example usage for android.support.v4.graphics ColorUtils distanceEuclidean

List of usage examples for android.support.v4.graphics ColorUtils distanceEuclidean

Introduction

In this page you can find the example usage for android.support.v4.graphics ColorUtils distanceEuclidean.

Prototype

public static double distanceEuclidean(@NonNull double[] labX, @NonNull double[] labY) 

Source Link

Document

Returns the euclidean distance between two LAB colors.

Usage

From source file:arun.com.chromer.util.ColorUtil.java

private static double colorDifference(@ColorInt int a, @ColorInt int b) {
    double aLab[] = new double[3];
    double bLab[] = new double[3];
    ColorUtils.colorToLAB(a, aLab);/*from  w w w  .j a  v  a  2s. co  m*/
    ColorUtils.colorToLAB(b, bLab);
    return ColorUtils.distanceEuclidean(aLab, bLab);
}