Class ContrastRatioChecker
- java.lang.Object
-
- org.verapdf.wcag.algorithms.semanticalgorithms.ContrastRatioChecker
-
public class ContrastRatioChecker extends Object
-
-
Constructor Summary
Constructors Constructor Description ContrastRatioChecker()
-
Method Summary
All Methods Instance Methods Concrete Methods Modifier and Type Method Description voidcheckDocument(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.
-
-
-
Method Detail
-
checkSemanticTree
public void checkSemanticTree(ITree tree, String pdfName)
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.
-
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
-
-