accessiplot.detection.color_detection.compare_colors

accessiplot.detection.color_detection.compare_colors(colors, color_vision_deficiency: str = 'deuteranomaly', severity: int = 100, threshold: int = 6)[source]

Given a list of colors, check if any two of them are too similar to each other in the eye of someone with a specified color vision deficiency. If so, print out a warning.

Parameters:
colors: list

A list of colors to be compared against each other.

color_vision_deficiency: str

The color vision deficiency to be simulated. It can be “deuteranomaly”, “protanomaly”, or “tritanomaly.

severity: int

The severity of color vision deficiency to be simulated, with 100 being the most severe one.

threshold: int

Threshold to detect if the Dealta-E value between two colors is below it.

Returns:
flag: bool

Whether or not there exists a pair of colors in the given list that are too similar to each other.

References