{"uid":"cap_Mm_6IAn5LL6mHUO5u__uH","slug":"writerslogic-wcag-contrast-checker-fixer-106e241c","name":"WritersLogic WCAG Contrast Checker & Fixer","description":"Pay-per-call agents settled in USDC on Base via x402. Every response carries a signed provenance envelope.","url":"https://agents.writerslogic.com/api/v1/contrast-fix?utm_source=zero.xyz","method":"POST","headers":{},"bodySchema":{"type":"object","properties":{"level":{"enum":["aa-normal","aa-large","aaa-normal","aaa-large","non-text"],"type":"string","description":"aa-normal 4.5 (default), aa-large 3, aaa-normal 7, aaa-large 4.5, non-text 3 (WCAG 2.2 SC 1.4.3, 1.4.6, 1.4.11)."},"pairs":{"type":"array","items":{"type":"object","required":["foreground","background"],"properties":{"label":{"type":"string","maxLength":80,"description":"Caller label echoed back."},"background":{"type":"string","pattern":"^#([0-9a-fA-F]{3}|[0-9a-fA-F]{6})$","maxLength":7,"description":"#rgb or #rrggbb."},"foreground":{"type":"string","pattern":"^#([0-9a-fA-F]{3}|[0-9a-fA-F]{6})$","maxLength":7,"description":"#rgb or #rrggbb (strict hex; no names, no alpha)."},"claimedRatio":{"type":"number","maximum":21,"minimum":1,"description":"A ratio the caller asserts; compared to the unrounded ratio with a 0.01 tolerance."}}},"maxItems":50,"minItems":1,"description":"Foreground/background pairs."},"fixTarget":{"enum":["foreground","background","none"],"type":"string","description":"Which colour to move for a failing pair (default foreground); none skips the fix."},"threshold":{"type":"number","maximum":21,"minimum":1,"description":"Overrides level: the minimum contrast ratio."},"cvdSeverity":{"type":"number","maximum":1,"minimum":0,"description":"Enables the colour-vision-deficiency check at this severity, 0 to 1 (1.0 is dichromacy); between the published 0.1 steps the matrices are interpolated."},"cvdMinDeltaE":{"type":"number","maximum":2,"minimum":0,"description":"Smallest OKLab distance counted as distinguishable (default 0.05, a heuristic, not a standard)."}}},"responseSchema":{"type":"json"},"example":null,"exampleRequest":null,"tags":["x402"],"displayCostAmount":"0.005","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.005/call","primary":{"kind":"static","protocol":"x402","network":"base","amountUsd":"0.005","per":"call","confidence":"exact"},"accepted":[{"kind":"static","protocol":"x402","network":"base","amountUsd":"0.005","per":"call","confidence":"exact"}]},"paymentMethods":[{"uid":"pm_4LKcTYk5VKN6alRmC1tL2","protocol":"x402","methodType":"crypto","chain":"base","mode":"charge","costAmount":"0.005","costPer":"request","priority":0,"asset":"0x833589fCD6eDb6E08f4c7C32D4f71b54bdA02913","unit":"request","depositMicros":null,"planRef":null}],"brandName":null,"brandSlug":null,"brandBaseUrl":null,"brandDocsUrl":null,"whatItDoes":"Validates foreground/background hex color pairs against WCAG 2.2 contrast ratios, returns fixed colors for failing pairs using OKLCH lightness adjustment, and optionally simulates color vision deficiencies","exampleAgentPrompt":"Check these two color pairs for WCAG AA normal text compliance and fix any that fail by adjusting the foreground: #1a1a1a on #ffffff, and #777777 on #f0f0f0. Also run a protanomaly simulation at severity 0.8 to see if they stay distinguishable.","exampleUseCases":[{"title":"Design system palette accessibility audit","prompt":"I have a set of brand colors to audit for our design system — check these pairs for WCAG AA normal text (4.5:1): #3b6fd4 on #ffffff, #e8e8e8 on #ffffff, and #ff6b35 on #1a1a1a. For any that fail, give me the closest fixed foreground color that passes."},{"title":"Colorblind-safe palette validation","prompt":"Run a color vision deficiency check on my palette pairs — #2ecc71 on #ffffff and #e74c3c on #ffffff — at deuteranomaly severity 1.0 (full dichromacy), and tell me if they're still distinguishable from each other by OKLab distance."},{"title":"AAA compliance check for legal document UI","prompt":"Validate these text color combinations against WCAG AAA normal text (7:1) and fix the background color on any failures: #595959 on #f5f5f5 and #4a4a9e on #e0e8ff. I need the highest contrast level for a legal document reader."}],"resultDescription":"For each submitted color pair: the unrounded contrast ratio, a pass/fail flag for the requested WCAG level, and (if failing and fixTarget is not 'none') the adjusted hex color (OKLCH lightness-shifted, chroma/hue preserved, gamut-clipped to 8-bit sRGB) that just meets the threshold. If CVD simulation is enabled, also returns whether the pair remains distinguishable under the specified color vision deficiency type at the given severity, using OKLab delta-E distance. The caller-supplied label is echoed back for each pair. If claimedRatio is supplied, a flag indicates whether it matches the computed ratio within 0.01.","failureModes":["Invalid hex color format (not #rgb or #rrggbb) returns a validation error","Submitting more than 50 pairs returns a schema error","Threshold or ratio outside 1–21 range is rejected","No fix is possible if even pure black or white fails the threshold (edge case for extreme custom thresholds)","CVD severity outside 0–1 range is rejected","Colors with alpha channel or CSS color names are not accepted"],"whenToPreferThis":"Use this endpoint when you need programmatic, batch WCAG 2.2 contrast validation and automatic color fixing in a single call, especially when generating or auditing design system palettes. It is the right choice when you need OKLCH-based color correction that preserves hue and chroma, or when you need to verify color distinguishability for color-blind users under specific CVD types and severities. Prefer this over manual tools or general LLM color advice when you need deterministic, standards-compliant ratio computation on the unrounded value. Not suitable for APCA contrast, opacity handling, gradients, or non-sRGB color spaces.","instructions":null,"reviewSummary":null,"reviewSummaryHighlights":null,"reviewSummaryConcerns":null,"reviewSummaryGeneratedAt":null,"activationCount":0,"lastUsedAt":null,"lastSuccessfullyRanAt":null,"lastHealthCheckAt":"2026-11-18T18:40:46.453Z","isFirstParty":false,"canonicalSlug":"writerslogic-wcag-contrast-checker-fixer-106e241c"}