{"uid":"cap_O3XA6wF5dCbnIL27VSu6y","slug":"wcag-2-x-srgb-contrast-calculator-eaf05ed4","name":"WCAG 2.x sRGB Contrast Calculator","description":"Calculate WCAG 2.x sRGB contrast for one caller-supplied colour pair; no interface-wide accessibility claim is made.","url":"https://api.zfinia.com/x402/v1/accessibility-contrast-calculator","method":"POST","headers":{},"bodySchema":{"type":"object","properties":{"background":{"type":"string","pattern":"^#[0-9a-fA-F]{6}$"},"foreground":{"type":"string","pattern":"^#[0-9a-fA-F]{6}$"},"large_text":{"type":"boolean"}}},"responseSchema":{"type":"json","example":{"wcag_aa":true,"wcag_aaa":true,"large_text":false,"request_id":"example-request","service_id":"accessibility_contrast_calculator","limitations":["Calculation uses WCAG 2.x sRGB contrast; it does not assess full interface accessibility."],"contrast_ratio":21,"service_version":"1.0.0"}},"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_gbxglJBQShHZ6LLhloHwE","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":"Calculates the WCAG 2.x sRGB contrast ratio for a caller-supplied pair of foreground and background colours.","exampleAgentPrompt":"Can you calculate the WCAG 2.x sRGB contrast ratio between a foreground colour of #1A1A1A and a background colour of #FFFFFF so I can check if it passes accessibility standards?","exampleUseCases":[{"title":"Checking text readability on brand background","prompt":"I want to use #003087 as my text colour on a #F5F5F5 background — can you calculate the WCAG sRGB contrast ratio and tell me if it passes AA or AAA?"},{"title":"Validating button colour accessibility","prompt":"My call-to-action button is #FF6B00 with white (#FFFFFF) text on it — what's the contrast ratio and does it meet WCAG 2.x requirements?"},{"title":"Dark mode colour pair evaluation","prompt":"For our dark mode UI, we're using #E0E0E0 text on a #121212 background — please compute the WCAG sRGB contrast ratio so we know if it's accessible."}],"resultDescription":"Returns the computed WCAG 2.x sRGB contrast ratio (a numeric value between 1:1 and 21:1) for the supplied colour pair, along with pass/fail status against standard WCAG compliance thresholds (AA and/or AAA levels for normal and large text).","failureModes":["Invalid colour format provided (e.g. malformed hex or out-of-range sRGB values) — returns validation error","Missing foreground or background colour in request body — returns bad request error","Contrast ratio computable but no WCAG level claim made at interface-wide scope — result is per-pair only","Network or service unavailability — returns 5xx error"],"whenToPreferThis":"Choose this endpoint when you need a fast, deterministic, per-colour-pair WCAG 2.x sRGB contrast ratio calculation without needing a full accessibility audit tool. Ideal for design-time checks, CI pipelines validating colour tokens, or agent workflows that need to programmatically verify individual colour combinations meet minimum contrast thresholds before publishing UI assets.","instructions":null,"reviewSummary":null,"reviewSummaryHighlights":null,"reviewSummaryConcerns":null,"reviewSummaryGeneratedAt":null,"activationCount":0,"lastUsedAt":null,"lastSuccessfullyRanAt":null,"lastHealthCheckAt":"2026-09-14T12:39:04.089Z","isFirstParty":false}