{"uid":"cap_KJC7t5SdvwNr21B8CbmTt","slug":"wcag-color-contrast-ratio-checker-c5b91329","name":"WCAG Color Contrast Ratio Checker","description":"Compute the WCAG 2.x contrast ratio between two colors (hex #rgb or #rrggbb) and whether it passes AA/AAA for normal and large text. Deterministic — for accessible color choices without a tool in the loop.","url":"https://agent402.tools/api/color-contrast","method":"POST","headers":{},"bodySchema":{"type":"object","properties":{"background":{"type":"string","description":"background color (#rgb or #rrggbb)"},"foreground":{"type":"string","description":"text color (#rgb or #rrggbb)"}}},"responseSchema":{"type":"json","example":{"AA":{"large":true,"normal":false},"AAA":{"large":false,"normal":false},"ratio":4.48}},"example":null,"exampleRequest":null,"tags":["x402"],"displayCostAmount":"0.001","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.001/call","primary":{"kind":"static","protocol":"x402","network":"base","amountUsd":"0.001","per":"call","confidence":"exact"},"accepted":[{"kind":"static","protocol":"x402","network":"base","amountUsd":"0.001","per":"call","confidence":"exact"}]},"paymentMethods":[{"uid":"pm_2LIui3D2pxSbd7x4Tac3Y","protocol":"x402","methodType":"crypto","chain":"base","mode":"charge","costAmount":"0.001","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.x contrast ratio between a foreground and background color and returns AA/AAA pass/fail results for normal and large text.","exampleAgentPrompt":"What's the WCAG contrast ratio between a background of #1a1a2e and foreground text of #e0e0e0 — does it pass AA and AAA for both normal and large text?","exampleUseCases":null,"resultDescription":"Returns the numeric WCAG 2.x contrast ratio and boolean pass/fail results for AA (4.5:1 normal, 3:1 large) and AAA (7:1 normal, 4.5:1 large) conformance levels for both normal and large text sizes.","failureModes":["Invalid hex color format returns a 400 error","Missing foreground or background field returns validation error","Malformed #rgb shorthand not expanded correctly may cause parse error"],"whenToPreferThis":"Use this endpoint when you need a deterministic, standards-compliant WCAG 2.x contrast ratio calculation without relying on a vision model or manual lookup — especially useful in design automation pipelines, accessibility audits, or CI checks for UI components.","instructions":null,"reviewSummary":null,"reviewSummaryHighlights":null,"reviewSummaryConcerns":null,"reviewSummaryGeneratedAt":null,"activationCount":0,"lastUsedAt":null,"lastSuccessfullyRanAt":null,"lastHealthCheckAt":"2026-09-15T00:46:43.247Z","isFirstParty":false}