accessiplot.detection.contrast_ratio.is_contrast_ratio_below_threshold

accessiplot.detection.contrast_ratio.is_contrast_ratio_below_threshold(contrast_ratio: float, threshold: float = 2.5)[source]

Pass in a contrast ratio and it will detect if it is below a limit.

Parameters:
contrast_ratiofloat

The contrast ratio calculated using the WCAG 2.0 definition.

thresholdfloat

Threshold to detect if the contrast ratio is below it.

Returns:
is_below_threshold: bool

Result of comparison of threshold and contrast ratio.