Class ContrastRatioChecker
java.lang.Object
org.verapdf.wcag.algorithms.semanticalgorithms.ContrastRatioChecker
-
Constructor Summary
Constructors -
Method Summary
Modifier and TypeMethodDescriptionvoidcheckDocument(IDocument document, String pdfName) voidcheckSemanticTree(ITree tree, String pdfName) Traverses the document semantic tree and updates contrast ratio parameter of it's nodes.doublegetContrastRatio(double first, double second) Determines contrast ratio of two color based on their relative luminance.
-
Constructor Details
-
ContrastRatioChecker
public ContrastRatioChecker()
-
-
Method Details
-
checkSemanticTree
Traverses the document semantic tree and updates contrast ratio parameter of it's nodes. Uses pdf document associated with the tree to determine contrast ratio by rendering it's pages. -
checkDocument
-
getContrastRatio
public double getContrastRatio(double first, double second) Determines contrast ratio of two color based on their relative luminance. The resulting contrast ratio ranges from 1.0 to 21.0- Parameters:
first- relative luminance of the first colorsecond- relative luminance of the first color- Returns:
- contrast ratio of the given colors
-