Class ColorPaletteAnalyzer

java.lang.Object
org.episteme.social.arts.ColorPaletteAnalyzer

public final class ColorPaletteAnalyzer extends Object
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)
  • 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 color
      c2 - the second color
      Returns:
      the Euclidean distance (perceptual difference) as a Real
    • getComplementary

      public static ColorPaletteAnalyzer.ColorLAB getComplementary(ColorPaletteAnalyzer.ColorLAB color)
      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 for
      palette - the list of colors representing the artwork's palette
      threshold - 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