{"uid":"cap_hKRHlW-Dr9JLx_UR4Fduu","slug":"color-toolkit-contrast-ratio-calculator-08ce3735","name":"Color Toolkit – Contrast Ratio Calculator","description":"Compute the WCAG 2.1 contrast ratio between two colors and whether it passes AA/AAA.","url":"https://color.openverbs.com/v1/contrast","method":"POST","headers":{},"bodySchema":{"type":"object","$schema":"https://json-schema.org/draft/2020-12/schema","required":["input"],"properties":{"input":{"type":"object","required":["type","method","bodyType","body"],"properties":{"body":{"type":"object","required":["foreground","background"],"properties":{"background":{"type":"string","maxLength":128,"minLength":1,"description":"Background color."},"foreground":{"type":"string","maxLength":128,"minLength":1,"description":"Text/foreground color."}},"additionalProperties":false},"type":{"type":"string","const":"http"},"method":{"enum":["POST"],"type":"string"},"bodyType":{"enum":["json","form-data","text"],"type":"string"}},"additionalProperties":false}}},"responseSchema":null,"example":null,"exampleRequest":null,"tags":["x402"],"displayCostAmount":"0.002","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.002/call","primary":{"kind":"static","protocol":"x402","network":"base","amountUsd":"0.002","per":"call","confidence":"exact"},"accepted":[{"kind":"static","protocol":"x402","network":"base","amountUsd":"0.002","per":"call","confidence":"exact"}]},"paymentMethods":[{"uid":"pm_8BFAjU317SBzQ2MQzTpww","protocol":"x402","methodType":"crypto","chain":"base","mode":"charge","costAmount":"0.002","costPer":"request","priority":0,"asset":"0x833589fCD6eDb6E08f4c7C32D4f71b54bdA02913","unit":"request","depositMicros":null,"planRef":null}],"brandName":null,"brandSlug":null,"brandBaseUrl":null,"brandDocsUrl":null,"whatItDoes":"Computes the contrast ratio between a foreground (text) color and a background color to assess accessibility compliance","exampleAgentPrompt":"Can you check the contrast ratio between the text color #FFFFFF and the background color #1A237E to see if it passes accessibility standards?","exampleUseCases":[{"title":"WCAG compliance check for brand colors","prompt":"I'm designing a website and need to know if my brand's navy blue background (#003366) with white text (#FFFFFF) passes WCAG contrast requirements — can you check the contrast ratio?"},{"title":"Accessibility audit for dark mode UI","prompt":"Check whether light gray text (#CCCCCC) on a dark charcoal background (#2B2B2B) has sufficient contrast ratio for our dark mode design to be accessible."},{"title":"Button label readability check","prompt":"Does the text color #F57C00 (orange) on a white (#FFFFFF) background have enough contrast to be readable on my call-to-action buttons?"}],"resultDescription":"Returns the computed contrast ratio between the two specified colors (foreground and background), typically as a numeric ratio (e.g. 4.5:1), along with an indication of whether the pair passes WCAG AA or AAA accessibility thresholds for normal and large text.","failureModes":["Invalid or unrecognized color format for foreground or background (e.g. malformed hex, unsupported color name) returns an error","Missing required fields (foreground or background) returns a validation error","Extreme edge cases like transparent or undefined colors may return an error"],"whenToPreferThis":"Choose this endpoint when you need a fast, programmatic contrast ratio calculation between exactly two colors — foreground and background — especially for WCAG accessibility compliance checks in UI/UX workflows, design audits, or automated accessibility testing pipelines. Prefer it over manual tools when integrating color accessibility validation into an agent-driven design or code review workflow.","instructions":null,"reviewSummary":null,"reviewSummaryHighlights":null,"reviewSummaryConcerns":null,"reviewSummaryGeneratedAt":null,"activationCount":0,"lastUsedAt":null,"lastSuccessfullyRanAt":null,"lastHealthCheckAt":"2026-09-14T18:41:21.642Z","isFirstParty":false}