{"uid":"cap_RBK2tYl9P-j4Ov11tRzr9","slug":"color-agentutil-net-4ec2ac32","name":"WCAG 2.1 Contrast Ratio Calculator","description":"Calculate WCAG 2.1 contrast ratio between two colors","url":"https://color.agentutil.net/v1/contrast?utm_source=zero.xyz","method":"POST","headers":{},"bodySchema":{"type":"object","properties":{"background":{"type":"string","description":"Background color (hex, rgb(), hsl(), or CSS name)"},"foreground":{"type":"string","description":"Foreground color (hex, rgb(), hsl(), or CSS name)"}}},"responseSchema":{"type":"object","required":["ratio","service","aa_large","aa_normal","aaa_large","aaa_normal","background","foreground","request_id","related_services"],"properties":{"ratio":{"type":"number"},"service":{"type":"string"},"aa_large":{"type":"boolean"},"aa_normal":{"type":"boolean"},"aaa_large":{"type":"boolean"},"aaa_normal":{"type":"boolean"},"background":{"type":"string"},"foreground":{"type":"string"},"request_id":{"type":"string"},"related_services":{"type":"array","items":{"type":"object","required":["url","name","description"],"properties":{"url":{"type":"string"},"name":{"type":"string"},"description":{"type":"string"}}}}}},"example":{"request":{"background":"#FFFFFF","foreground":"#000000"},"response":{"ratio":21,"service":"https://color.agentutil.net","aa_large":true,"aa_normal":true,"aaa_large":true,"aaa_normal":true,"background":"#ffffff","foreground":"#000000","request_id":"120f86e7-198b-41d3-98e1-6b2933b472ab","related_services":[{"url":"https://verify.agentutil.net","name":"verify","description":"Fact verification against live data sources -- exchange rates, crypto, stocks, entities, geography"},{"url":"https://docs.agentutil.net","name":"docs","description":"Search pre-indexed platform documentation -- semantic vector search across 10+ platforms"},{"url":"https://think.agentutil.net","name":"think","description":"Intent security -- pre-flight safety checklists, instruction expansion, and post-action review for autonomous agents"},{"url":"https://convert.agentutil.net","name":"convert","description":"Unit conversion (80+ units), live currency rates, and encoding (base64, hex, URL)"},{"url":"https://weather.agentutil.net","name":"weather","description":"Current conditions and multi-day forecasts for any location worldwide via Open-Meteo"},{"url":"https://validate.agentutil.net","name":"validate","description":"Validate emails (RFC 5322), URLs, phone numbers (E.164), credit cards (Luhn), and JSON schemas"},{"url":"https://time.agentutil.net","name":"time","description":"Timezone conversion, current time in any timezone, date arithmetic, and epoch conversions"},{"url":"https://hash.agentutil.net","name":"hash","description":"Hash with MD5/SHA-256/SHA-512, encode/decode base64/hex/URL, generate UUIDs, identify hash algorithms"},{"url":"https://text.agentutil.net","name":"text","description":"Regex match/replace/extract, text diff, slugify, word count, and markdown/HTML/JSON transforms"},{"url":"https://math.agentutil.net","name":"math","description":"Safe expression evaluation, statistics (mean/median/stddev/percentiles), percentages, and rounding"},{"url":"https://geocode.agentutil.net","name":"geocode","description":"Forward geocoding (address to lat/lon), reverse geocoding (lat/lon to address), and haversine distance"},{"url":"https://dns.agentutil.net","name":"dns","description":"DNS record lookups (A/MX/TXT/NS), reverse DNS, WHOIS/RDAP domain data, and IP geolocation"},{"url":"https://undo.agentutil.net","name":"undo","description":"Reversibility intelligence -- check if actions can be undone, find safer alternatives, batch safety warnings"},{"url":"https://norm.agentutil.net","name":"norm","description":"Baseline reality checks -- statistical anomaly detection for values against published industry benchmarks"},{"url":"https://context.agentutil.net","name":"context","description":"Situational awareness -- timezone, holiday, business calendar, and platform status checks before taking action"},{"url":"https://random.agentutil.net","name":"random","description":"Secure random generation -- passwords, UUIDs (v4/v7), API tokens, numbers with dice notation, and random picks/shuffles"},{"url":"https://cron.agentutil.net","name":"cron","description":"Cron expression tools -- explain, parse natural language to cron, calculate next execution times, and validate expressions"},{"url":"https://useragent.agentutil.net","name":"useragent","description":"User agent parsing -- browser/OS/device detection, bot/crawler identification with 50+ patterns, and UA comparison"}]}},"exampleRequest":{"background":"#FFFFFF","foreground":"#000000"},"tags":["x402"],"displayCostAmount":"0.001","displayCostAsset":"USDC","priceDynamic":false,"priceHint":null,"priceStatus":"priced","priceSource":"settled","requiresHandshake":false,"reviewCount":0,"rating":{"score":"0.00","successRate":"1.00","reviews":0,"stars":null,"state":"rated"},"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_48oKT_bfrIM1baJhB3nwC","protocol":"x402","methodType":"crypto","chain":"base","mode":"charge","costAmount":"0.001","costPer":"request","priority":0,"asset":null,"unit":"request","depositMicros":null,"planRef":null}],"brandName":null,"brandSlug":null,"brandBaseUrl":null,"brandDocsUrl":null,"whatItDoes":"Calculates the WCAG 2.1 contrast ratio between a foreground and background color, and returns pass/fail results for AA and AAA accessibility standards at normal and large text sizes.","exampleAgentPrompt":"What's the WCAG 2.1 contrast ratio between a white background (#FFFFFF) and dark navy foreground (#1A2E4A), and does it pass AA and AAA standards for both normal and large text?","exampleUseCases":null,"resultDescription":"Returns a numeric contrast ratio (e.g. 21 for black-on-white), boolean pass/fail flags for WCAG 2.1 AA and AAA compliance at both normal and large text sizes, the normalized hex values of the input colors, a request ID, and a list of related agentutil services.","failureModes":["Invalid color format provided — returns error if hex, rgb(), hsl(), or CSS name cannot be parsed","Missing required field (background or foreground) — returns validation error","Unrecognized CSS color name — returns parsing error"],"whenToPreferThis":"Use this endpoint when you need to programmatically verify color accessibility compliance per WCAG 2.1 — especially when building or auditing UI components, design systems, or web pages and need pass/fail verdicts across all four WCAG contrast thresholds (AA/AAA × normal/large text) in a single call. Prefer this over manual calculation or generic color tools when you need structured, machine-readable results including the numeric ratio and boolean compliance flags.","instructions":null,"reviewSummary":null,"reviewSummaryHighlights":null,"reviewSummaryConcerns":null,"reviewSummaryGeneratedAt":null,"activationCount":4,"lastUsedAt":"2026-04-29T18:00:56.673Z","lastSuccessfullyRanAt":"2026-04-29T18:00:56.673Z","lastHealthCheckAt":"2026-10-10T18:34:16.507Z","isFirstParty":false,"canonicalSlug":"color-agentutil-net-4ec2ac32"}