accessiplot.detection.contrast_ratio.calculate_contrast_ratios_from_ax

accessiplot.detection.contrast_ratio.calculate_contrast_ratios_from_ax(dh: DetectionHandler)[source]

Generates dictionaries of the contrast_ratios_by_index and detections. Also a list of colors_by_index is generated to keep track of the colors that are associated with the contrast ratios. It determines the processing logic based on the chart type from the DetectionHandler object.

Parameters:
dhaccessiplot.detection.handler.DetectionHandler

A DetectionHandler object that contains the axes object and histogram object if necessary.

Returns:
contrast_ratios_by_index: dict

Dictionary where the key is the indices of the lines/background being compared and the value is the contrast ratio as a float.

colors_by_index: list

List where each element is a tuple of (r, g, b) where r, g, and b are normalized from the 0->255 value down to a 0->1 value.

detections: dict

Dictionary where the key is the indices of the lines/background being compared and the value is the contrast ratio as a float.