{"uid":"cap_Cuf8lMx0_3tX7rXv7JYE0","slug":"saylor-innovations-wcag-contrast-ratio-calculator-8f05f270","name":"Saylor Innovations WCAG Contrast Ratio Calculator","description":"WCAG contrast ratio calculator for two sRGB colors - luminance, ratio and AA/AAA flags","url":"https://saylorinnovations.com/api/accessibility/contrast?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","queryParams"],"properties":{"type":{"type":"string","const":"http"},"method":{"enum":["GET"],"type":"string"},"queryParams":{"type":"object","required":["foreground","background"],"properties":{"background":{"type":"string","description":"required RGB such as 255,255,255 (query)"},"foreground":{"type":"string","description":"required RGB such as 0,0,0 (query)"}}}},"additionalProperties":false},"output":{"type":"object","required":["type"],"properties":{"type":{"type":"string","const":"json"},"example":{"type":"object","required":["foreground_rgb","background_rgb","contrast_ratio","aa_normal","aaa_normal","scope_note"],"properties":{"formula":{"type":"string","description":"Formula used for the calculation"},"aa_large":{"type":"boolean","description":"Aa large"},"aa_normal":{"type":"boolean","description":"Aa normal"},"aaa_large":{"type":"boolean","description":"Aaa large"},"aaa_normal":{"type":"boolean","description":"Aaa normal"},"scope_note":{"type":"string","description":"What this data covers and what it leaves out"},"background_rgb":{"type":"array","items":{"type":"number"},"description":"Background rgb"},"contrast_ratio":{"type":"number","description":"WCAG contrast ratio from 1 to 21"},"foreground_rgb":{"type":"array","items":{"type":"number"},"description":"Foreground rgb"}},"description":"Output fields observed in live endpoint responses; optionality and values can vary by record.","additionalProperties":true},"description":{"type":"string"}}}}},"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_5cECBw00F23lUaheJ-qj-","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":"Calculates the WCAG contrast ratio between two sRGB colors and returns luminance values plus AA/AAA compliance flags for normal and large text","exampleAgentPrompt":"Can you check if white text (255,255,255) on a dark navy background (10,25,70) passes WCAG AA and AAA contrast requirements for normal-sized text?","exampleUseCases":[{"title":"Checking brand palette accessibility","prompt":"I'm designing a website and want to use our brand orange (255,102,0) as text on a white background (255,255,255) — does that combination pass WCAG AA contrast standards for normal body text?"},{"title":"Validating button color accessibility","prompt":"Does a dark green button color (0,100,60) with white text (255,255,255) meet WCAG AAA accessibility requirements for large text?"},{"title":"Accessibility audit before launch","prompt":"Before I ship my redesign, can you tell me the exact WCAG contrast ratio between my gray text (120,120,120) and my light background (245,245,240), and whether it passes AA or AAA for normal and large text sizes?"}],"resultDescription":"Returns the foreground and background RGB arrays, the computed WCAG contrast ratio (1–21), boolean flags for AA and AAA compliance at both normal and large text sizes, the formula used, and a scope note describing what the calculation covers and its limitations.","failureModes":["Missing foreground or background query parameter returns an error","Malformed RGB string (e.g. non-numeric values or wrong number of components) causes a parsing error","RGB values outside 0–255 range may produce unexpected results","Network timeout or service unavailability returns a non-200 response"],"whenToPreferThis":"Use this endpoint when you need a quick, standards-based WCAG contrast ratio calculation for a pair of sRGB colors without standing up your own luminance math. It is ideal for accessibility auditing pipelines, design tools, or agent workflows that need to verify AA/AAA compliance flags in a single lightweight call. Prefer this over manual calculation or general-purpose color libraries when you want authoritative WCAG flags returned directly as structured JSON.","instructions":null,"reviewSummary":null,"reviewSummaryHighlights":null,"reviewSummaryConcerns":null,"reviewSummaryGeneratedAt":null,"activationCount":0,"lastUsedAt":null,"lastSuccessfullyRanAt":null,"lastHealthCheckAt":"2026-12-02T18:37:07.868Z","isFirstParty":false,"canonicalSlug":"saylor-innovations-wcag-contrast-ratio-calculator-8f05f270"}