{"uid":"cap_0ylFLmnl1uCmrscTAxSDD","slug":"accessible-text-color-checker-ff23f8f0","name":"Accessible Text Color Checker","description":"Best text color (black or white) for a background hex color, with contrast ratios and WCAG AA/AAA results for both.","url":"https://color-design.x402tookit.com/accessible-text-color?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"],"properties":{"type":{"type":"string","const":"http"},"method":{"enum":["GET"],"type":"string"},"queryParams":{"type":"object","required":["background"],"properties":{"background":{"type":"string","description":"Background hex color"}}}},"additionalProperties":false},"output":{"type":"object","required":["type"],"properties":{"type":{"type":"string"},"example":{"type":"object","properties":{"asOf":{"type":["null","string"]},"best":{"type":["null","string"]},"black":{"type":["null","object"],"properties":{"AA":{"type":["boolean","null"]},"AAA":{"type":["boolean","null"]},"ratio":{"type":["null","number"]},"AALarge":{"type":["boolean","null"]}}},"white":{"type":["null","object"],"properties":{"AA":{"type":["boolean","null"]},"AAA":{"type":["boolean","null"]},"ratio":{"type":["null","number"]},"AALarge":{"type":["boolean","null"]}}},"source":{"type":["null","string"]},"reasons":{"type":["array","null"],"items":{"type":"string"}},"summary":{"type":["null","string"]},"verdict":{"type":["null","string"]},"degraded":{"type":["boolean","null"]},"background":{"type":["null","string"]},"disclaimer":{"type":["null","string"]},"notChecked":{"type":["array","null"],"items":{"type":"string"}}}}}}}},"responseSchema":null,"example":null,"exampleRequest":null,"tags":["x402"],"displayCostAmount":"0.02","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.02/call","primary":{"kind":"static","protocol":"x402","network":"base","amountUsd":"0.02","per":"call","confidence":"exact"},"accepted":[{"kind":"static","protocol":"x402","network":"base","amountUsd":"0.02","per":"call","confidence":"exact"}]},"paymentMethods":[{"uid":"pm_SbQlE1QXN0hXoESehEHwn","protocol":"x402","methodType":"crypto","chain":"base","mode":"charge","costAmount":"0.02","costPer":"request","priority":0,"asset":"0x833589fCD6eDb6E08f4c7C32D4f71b54bdA02913","unit":"request","depositMicros":null,"planRef":null}],"brandName":null,"brandSlug":null,"brandBaseUrl":null,"brandDocsUrl":null,"whatItDoes":"Returns the best text color (black or white) for a given background hex color, including contrast ratios and WCAG AA/AAA compliance results for both options.","exampleAgentPrompt":"What's the best text color to use on a #2D6A4F background — black or white — and does it pass WCAG AA and AAA?","exampleUseCases":[{"title":"Accessible brand color text check","prompt":"My brand's primary color is #E63946 — should I put black or white text on it to meet WCAG AA accessibility standards? Show me the contrast ratios for both."},{"title":"Dark mode UI contrast validation","prompt":"I'm designing a dark mode UI with a background of #121212. Tell me whether black or white text is more accessible on it and whether it passes WCAG AAA."},{"title":"Accessible button label color","prompt":"I have a call-to-action button with hex color #F4A261. Which text color, black or white, gives better contrast, and does it pass WCAG AA for normal text?"}],"resultDescription":"Returns a JSON object indicating the best text color (black or white), the contrast ratio for each option, WCAG AA/AAA/AA-Large pass/fail results for both, a human-readable summary, verdict, and reasons explaining the recommendation. Also includes the background color echoed back and optional degraded/disclaimer flags.","failureModes":["Missing or malformed background hex value returns an error","Invalid hex string (e.g. wrong length or non-hex characters) may return a 400 or error response","Edge cases like pure white or pure black backgrounds may produce degenerate contrast results","Service unavailability or payment failure returns a 402 or 5xx error"],"whenToPreferThis":"Use this endpoint when you need a quick, authoritative WCAG-grounded decision on whether black or white text is more accessible on a specific background color. It is ideal for accessibility audits, design systems, UI generators, or any workflow where you need contrast ratios and compliance verdicts without implementing the WCAG luminance math yourself.","instructions":null,"reviewSummary":null,"reviewSummaryHighlights":null,"reviewSummaryConcerns":null,"reviewSummaryGeneratedAt":null,"activationCount":0,"lastUsedAt":null,"lastSuccessfullyRanAt":null,"lastHealthCheckAt":"2026-10-30T00:35:00.931Z","isFirstParty":false,"canonicalSlug":"accessible-text-color-checker-ff23f8f0"}