{"uid":"cap_1yjXt2XrIueJAZ3miQZrW","slug":"agentstoolshub-wcag-contrast-ratio-checker-54f8e25a","name":"AgentsToolsHub WCAG Contrast Ratio Checker","description":"Compute the WCAG 2.1 contrast ratio between a text and background color with pass/fail against every accessibility threshold: AA and AAA for normal and large text, plus the 3:1 UI-component minimum. Exact luminance math — the check every design system needs. Use this when an agent needs to contrast ratio + AA/AAA pass/fail.","url":"https://agentstoolshub.com/api/v1/media/contrast-check?utm_source=zero.xyz","method":"GET","headers":{},"bodySchema":{"type":"object","$schema":"https://json-schema.org/draft/2020-12/schema","required":["input"],"properties":{"input":{"type":"object","required":["type","method"],"properties":{"type":{"type":"string","const":"http"},"method":{"enum":["GET"],"type":"string"},"queryParams":{"type":"object","required":["foreground","background"],"properties":{"background":{"type":"string","description":"Background color"},"foreground":{"type":"string","description":"Text color"}}}},"additionalProperties":false},"output":{"type":"object","required":["type"],"properties":{"type":{"type":"string"},"example":{"type":"object"}}}}},"responseSchema":null,"example":null,"exampleRequest":null,"tags":["x402"],"displayCostAmount":"0.01","displayCostAsset":"USDC","priceDynamic":false,"priceHint":null,"priceStatus":"priced","priceSource":"probe","requiresHandshake":false,"reviewCount":0,"rating":{"score":"0.00","successRate":"0.00","reviews":0,"stars":null,"state":"unrated"},"availabilityStatus":"unknown","priceObserved":null,"sessionDeposit":null,"pricing":{"kind":"static","summary":"$0.01/call","primary":{"kind":"static","protocol":"x402","network":"base","amountUsd":"0.01","per":"call","confidence":"exact"},"accepted":[{"kind":"static","protocol":"x402","network":"base","amountUsd":"0.01","per":"call","confidence":"exact"}]},"paymentMethods":[{"uid":"pm_6lD4ttsdr6kdjWrlZL1Gp","protocol":"x402","methodType":"crypto","chain":"base","mode":"charge","costAmount":"0.01","costPer":"request","priority":0,"asset":"0x833589fCD6eDb6E08f4c7C32D4f71b54bdA02913","unit":"request","depositMicros":null,"planRef":null}],"brandName":null,"brandSlug":null,"brandBaseUrl":null,"brandDocsUrl":null,"whatItDoes":"Computes the WCAG 2.1 contrast ratio between a foreground text color and background color, returning pass/fail results for AA and AAA accessibility thresholds for normal text, large text, and UI components.","exampleAgentPrompt":"Can you check whether white text (#FFFFFF) on a navy background (#003366) passes WCAG 2.1 AA and AAA contrast requirements for both normal and large text?","exampleUseCases":[{"title":"Design system accessibility audit","prompt":"I'm building a component library and need to know if my primary button — light gray text (#F5F5F5) on a medium blue (#2563EB) — meets WCAG AA and AAA contrast standards for normal text, large text, and UI components."},{"title":"Color palette accessibility review","prompt":"We're finalizing our brand colors and I need to check if our dark green (#1A5C2A) on a white background (#FFFFFF) passes WCAG 2.1 contrast thresholds at both the AA and AAA levels."},{"title":"Catch failing colors before launch","prompt":"Before we ship, can you run a contrast check on our footer text color #757575 against the background #F0F0F0 and tell me exactly which WCAG 2.1 levels it passes or fails?"}],"resultDescription":"Returns the computed WCAG 2.1 contrast ratio as a numeric value, relative luminance for both foreground and background colors, and individual pass/fail results for AA normal text (4.5:1), AA large text (3:1), AAA normal text (7:1), AAA large text (4.5:1), and the 3:1 UI component minimum threshold.","failureModes":["Invalid or unparseable color format provided (e.g. unsupported color string) returns an error","Missing required foreground or background query parameter returns a 400 bad request","Malformed hex codes or unsupported color spaces may result in computation errors"],"whenToPreferThis":"Choose this endpoint when you need exact WCAG 2.1 luminance-based contrast math with granular AA/AAA pass/fail results for all text sizes and UI component thresholds — ideal for design system validation, automated accessibility audits, or pre-ship color checks where precise compliance verdicts are required rather than approximate visual assessments.","instructions":null,"reviewSummary":null,"reviewSummaryHighlights":null,"reviewSummaryConcerns":null,"reviewSummaryGeneratedAt":null,"activationCount":0,"lastUsedAt":null,"lastSuccessfullyRanAt":null,"lastHealthCheckAt":"2026-10-23T00:52:20.255Z","isFirstParty":false,"canonicalSlug":"agentstoolshub-wcag-contrast-ratio-checker-54f8e25a"}