qualpal::analyzePalette
C++ · cpp · 4.1.0
PaletteAnalysisMap Analyze a color palette for normal and simulated color vision deficiencies (CVD).
Computes color difference matrices and minimum color distances for the input palette, for normal vision as well as common color vision deficiencies ("deutan", "protan", "tritan") at the specified severity. Results are returned as a map keyed by vision type.
For each vision type:
Simulates the palette (and optional background) under the specified CVD severity.
Computes the pairwise color difference matrix using the selected metric.
Computes the minimum distance to any other color for each palette color.
Computes the minimum distance from the background (if provided) to the palette.
Parameters
colors
Vector of RGB colors to analyze. Each channel should be in [0, 1].
metric
Color difference metric to use (e.g., CIEDE2000, DIN99d, CIE76).
cvd
Map of CVD type ("deutan", "protan", "tritan") to severity [0, 1]. If a type is omitted or severity is 0, simulation is skipped for that type.
bg
Optional background color to include in the analysis (RGB in [0, 1]).
max_memory
Maximum memory (in GB) allowed for the difference matrix computation.
Returns
Map from vision type string to PaletteAnalysis for each simulated vision.
Throws
std::invalid_argument
if input parameters are invalid.
