Class ColorPaletteAnalyzer
java.lang.Object
org.episteme.social.arts.ColorPaletteAnalyzer
Analytical tool for extracting and evaluating color palettes within artworks.
It employs the CIELAB color space to calculate perceptual differences
(Delta E) and analyze color harmony and dominance.
- Since:
- 1.0
- Version:
- 2.0
- Author:
- Silvere Martin-Michiellot, Gemini AI (Google DeepMind)
-
Nested Class Summary
Nested ClassesModifier and TypeClassDescriptionstatic final recordRepresents a color in the CIE 1976 (L*, a*, b*) color space. -
Method Summary
Modifier and TypeMethodDescriptionstatic doublecalculateDominance(ColorPaletteAnalyzer.ColorLAB target, List<ColorPaletteAnalyzer.ColorLAB> palette, double threshold) Calculates the dominance fraction of a target color within a palette based on a perceptual similarity threshold.static RealCalculates the Delta E distance between two colors using the CIE76 formula.Computes the complementary color in the CIELAB space by inverting the chromatic a* and b* components while maintaining constant lightness.
-
Method Details
-
deltaE
Calculates the Delta E distance between two colors using the CIE76 formula. This metric quantifies the perceptual difference between colors as experienced by the human eye.- Parameters:
c1- the first colorc2- the second color- Returns:
- the Euclidean distance (perceptual difference) as a Real
-
getComplementary
Computes the complementary color in the CIELAB space by inverting the chromatic a* and b* components while maintaining constant lightness.- Parameters:
color- the source color- Returns:
- the complementary color coordinate
-
calculateDominance
public static double calculateDominance(ColorPaletteAnalyzer.ColorLAB target, List<ColorPaletteAnalyzer.ColorLAB> palette, double threshold) Calculates the dominance fraction of a target color within a palette based on a perceptual similarity threshold.- Parameters:
target- the reference color to measure dominance forpalette- the list of colors representing the artwork's palettethreshold- the Delta E limit below which colors are considered 'neighboring'- Returns:
- fraction (0.0 to 1.0) of the palette dominated by the target color
-