public class ColorDifference
extends java.lang.Object
| Modifier and Type | Field and Description |
|---|---|
static float |
weightingChroma
Weighting of the chroma for Lab / LCH difference measures
|
static float |
weightingHue
Weighting of the hue for Lab / LCH difference measures
|
static float |
weightingLuminance
Weighting of the luminance for Lab / LCH difference measures
|
| Modifier and Type | Method and Description |
|---|---|
static java.lang.Float |
difference(int color1,
int color2)
Calculates the difference / distance between two colors.
|
static java.lang.Float |
difference(RColor color1,
RColor color2)
Calculates the difference / distance between two colors.
|
static java.lang.Float |
difference(RColor color1,
RColor color2,
ColorDifferenceMeasure measure)
Calculates the difference / distance between two colors.
|
static java.lang.Integer |
getMostDifferentColor(RColor[] bases,
java.util.ArrayList<RColor> targets,
ColorDifferenceMeasure measure)
Calculates the most different color of all targets to the base colors.
|
static java.lang.Integer |
getMostDifferentColor(RColor[] bases,
RColor[] targets,
ColorDifferenceMeasure measure)
Calculates the most different color of all targets to the base colors.
|
static java.lang.Integer |
getMostDifferentColor(RColor base,
java.util.ArrayList<RColor> targets,
ColorDifferenceMeasure measure)
Calculates the most different color of all targets to the base color.
|
static java.lang.Integer |
getMostDifferentColor(RColor base,
RColor[] targets,
ColorDifferenceMeasure measure)
Calculates the most different color of all targets to the base color.
|
static java.lang.Integer |
getMostSimilarColor(RColor base,
java.util.ArrayList<RColor> targets,
boolean ignoreSelf,
ColorDifferenceMeasure measure)
Calculates the most similar color of all targets to the base color.
|
static java.lang.Integer |
getMostSimilarColor(RColor base,
java.util.ArrayList<RColor> targets,
ColorDifferenceMeasure measure)
Calculates the most similar color of all targets to the base color.
|
static java.lang.Integer |
getMostSimilarColor(RColor base,
RColor[] targets,
boolean ignoreSelf,
ColorDifferenceMeasure measure)
Calculates the most similar color of all targets to the base color.
|
static java.lang.Integer |
getMostSimilarColor(RColor base,
RColor[] targets,
ColorDifferenceMeasure measure)
Calculates the most similar color of all targets to the base color.
|
static java.lang.Float |
hsbCone(RColor color1,
RColor color2)
Calculates the difference / distance between two colors using HSB
Euclidean distance using the 3D interpretation of the color model.
|
static java.lang.Float |
hsbCylinder(RColor color1,
RColor color2)
Calculates the difference / distance between two colors using HSB
Euclidean distance using the 3D interpretation of the color model.
|
static java.lang.Float |
hsbEuclidean(RColor color1,
RColor color2)
Calculates the difference / distance between two colors using HSB
Euclidean distance.
|
static java.lang.Float |
labDeltaC(RColor color1,
RColor color2)
Calculates the chroma difference / distance between two colors.
|
static java.lang.Float |
labDeltaE(RColor color1,
RColor color2)
Calculates the difference / distance between two colors using Lab
Euclidean (Delta E) distance.
|
static java.lang.Float |
labDeltaE1994(RColor color1,
RColor color2)
Calculates the difference / distance between two colors using Lab Delta E
1994 distance.
|
static java.lang.Float |
labDeltaE2000(RColor color1,
RColor color2)
Calculates the difference / distance between two colors using Lab Delta E
2000 distance.
|
static java.lang.Float |
labDeltaH(RColor color1,
RColor color2)
Calculates the hue difference between two colors.
|
static java.lang.Float |
lchCMC(RColor color1,
RColor color2)
Calculates the difference / distance between two colors using CMC
distance.
|
static java.lang.Float |
lchEuclidean(RColor color1,
RColor color2)
Calculates the difference / distance between two colors using LCH
Euclidean distance.
|
static java.lang.Float |
rgbEuclidean(RColor color1,
RColor color2)
Calculates the difference / distance between two colors using RGB
Euclidean distance.
|
static java.lang.Float |
rgbMeanRed(RColor color1,
RColor color2)
Calculates the difference / distance between two colors using RGB
Euclidean distance weighted with a mean red value.
|
static java.lang.Float |
rgbWeighted(RColor color1,
RColor color2)
Calculates the difference / distance between two colors using weighted
RGB Euclidean distance.
|
static java.lang.Float |
xyzEuclidean(RColor color1,
RColor color2)
Calculates the difference / distance between two colors using XYZ
Euclidean distance.
|
public static float weightingLuminance
public static float weightingChroma
public static float weightingHue
public static java.lang.Integer getMostSimilarColor(RColor base, RColor[] targets, ColorDifferenceMeasure measure)
base - One color (not null).targets - Colors from which to chose the similar color from (not null,
but the values might be null).measure - A measure for the similarity (not null).public static java.lang.Integer getMostSimilarColor(RColor base, RColor[] targets, boolean ignoreSelf, ColorDifferenceMeasure measure)
base - - One color (not null).targets - Colors from which to chose the similar color from (not null,
but the values might be null).ignoreSelf - When true, base will be ignored when it is member of targets.measure - A measure for the similarity (not null).public static java.lang.Integer getMostSimilarColor(RColor base, java.util.ArrayList<RColor> targets, ColorDifferenceMeasure measure)
base - One color (not null).targets - Colors from which to chose the similar color from (not null,
but the values might be null).measure - A measure for the similarity (not null).public static java.lang.Integer getMostSimilarColor(RColor base, java.util.ArrayList<RColor> targets, boolean ignoreSelf, ColorDifferenceMeasure measure)
base - One color (not null).targets - Colors from which to chose the similar color from (not null,
but the values might be null).ignoreSelf - When true, base will be ignored when it is member of targets.measure - A measure for the similarity (not null).public static java.lang.Integer getMostDifferentColor(RColor base, RColor[] targets, ColorDifferenceMeasure measure)
base - One color (not null).targets - Colors from which to chose the different color from (not null,
but values might be null)measure - A measure for the similarity.public static java.lang.Integer getMostDifferentColor(RColor base, java.util.ArrayList<RColor> targets, ColorDifferenceMeasure measure)
base - - One color (not null).targets - - Colors from which to chose the different color from (not
null, but values might be null)measure - - A measure for the similarity.public static java.lang.Integer getMostDifferentColor(RColor[] bases, java.util.ArrayList<RColor> targets, ColorDifferenceMeasure measure)
bases - - Colors (not null).targets - - Colors from which to chose the different color from (not
null, but values might be null)measure - - A measure for the similarity.public static java.lang.Integer getMostDifferentColor(RColor[] bases, RColor[] targets, ColorDifferenceMeasure measure)
bases - - Colors (not null).targets - - Colors from which to chose the different color from (not
null, but values might be null)measure - - A measure for the similarity.public static java.lang.Float difference(int color1,
int color2)
color1 - One color.color2 - One color .public static java.lang.Float difference(RColor color1, RColor color2)
color1 - One color.color2 - One color .public static java.lang.Float difference(RColor color1, RColor color2, ColorDifferenceMeasure measure)
color1 - One color (not null).color2 - One color (not null).measure - A ColorDifferenceMeasure, e.g.
ColorDifferenceMeasure.RGBEuclideanpublic static java.lang.Float rgbEuclidean(RColor color1, RColor color2)
color1 - One color (not null).color2 - One color (not null).public static java.lang.Float rgbWeighted(RColor color1, RColor color2)
color1 - - One color (not null).color2 - - One color (not null).public static java.lang.Float rgbMeanRed(RColor color1, RColor color2)
color1 - One color (not null).color2 - One color (not null).public static java.lang.Float hsbEuclidean(RColor color1, RColor color2)
color1 - One color (not null).color2 - One color (not null).public static java.lang.Float hsbCylinder(RColor color1, RColor color2)
color1 - One color (not null).color2 - One color (not null).public static java.lang.Float hsbCone(RColor color1, RColor color2)
color1 - One color (not null).color2 - One color (not null).public static java.lang.Float xyzEuclidean(RColor color1, RColor color2)
color1 - One color (not null).color2 - One color (not null).public static java.lang.Float labDeltaC(RColor color1, RColor color2)
color1 - One color (not null).color2 - One color (not null).public static java.lang.Float labDeltaH(RColor color1, RColor color2)
color1 - One color (not null).color2 - One color (not null).public static java.lang.Float labDeltaE(RColor color1, RColor color2)
color1 - One color (not null).color2 - One color (not null).public static java.lang.Float labDeltaE1994(RColor color1, RColor color2)
color1 - One color (not null).color2 - One color (not null).public static java.lang.Float labDeltaE2000(RColor color1, RColor color2)
color1 - One color (not null).color2 - One color (not null).public static java.lang.Float lchCMC(RColor color1, RColor color2)
color1 - One color (not null).color2 - One color (not null).