Class WCagChecker

java.lang.Object
com.itextpdf.kernel.contrast.WCagChecker

public final class WCagChecker extends Object
Utility class for checking WCAG (Web Content Accessibility Guidelines) compliance for text contrast.
See Also:
  • Method Details

    • isTextWcagAACompliant

      public static boolean isTextWcagAACompliant (double fontSize, double contrastRatio)
      Checks for WCAG AA compliance.
      Parameters:
      fontSize - The font size in pixels
      contrastRatio - The contrast ratio between text and background
      Returns:
      true if the text meets WCAG AA compliance, false otherwise
    • isTextWcagAAACompliant

      public static boolean isTextWcagAAACompliant (double fontSize, double contrastRatio)
      Checks for WCAG AAA compliance.
      Parameters:
      fontSize - The font size in pixels
      contrastRatio - The contrast ratio between text and background
      Returns:
      true if the text meets WCAG AAA compliance, false otherwise