{"uid":"cap_i9qnVA0-MKC2wJaWBsNx8","slug":"402utils-color-utilities-05861f97","name":"402utils Color Utilities","description":"Colour utilities: ?op=convert (default) turns any hex/rgb()/hsl()/CSS-name into hex, rgb, hsl, hsv, alpha, relative luminance and exact CSS name; ?op=contrast with ?fg=&bg= returns the WCAG 2.x contrast ratio and AA/AAA pass/fail for normal & large text plus UI components (accessibility / EAA); ?op=palette derives complementary, analogous, triadic, tints and shades. Send hex without '#'.","url":"https://402utils.com/v1/color","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","properties":{"bg":{"type":"string","description":"Background colour (op=contrast). Falls back to `color` for fg."},"fg":{"type":"string","description":"Foreground colour (op=contrast)."},"op":{"enum":["convert","contrast","palette"],"type":"string","default":"convert"},"color":{"type":"string","description":"The colour (convert/palette): hex without '#', rgb(), hsl() or a CSS name."}},"description":"Query string only."}},"additionalProperties":false},"output":{"type":"object","required":["type"],"properties":{"type":{"type":"string"},"example":{"type":"object","required":["op"],"properties":{"AA":{"type":"object","description":"AA pass/fail for normalText, largeText, uiComponents."},"op":{"type":"string"},"AAA":{"type":"object","description":"AAA pass/fail for normalText, largeText."},"hex":{"type":"string"},"hsl":{"type":"object"},"hsv":{"type":"object"},"rgb":{"type":"object"},"name":{"type":["string","null"],"description":"Exact CSS colour name, if any."},"ratio":{"type":"number","description":"WCAG contrast ratio 1-21 (op=contrast)."},"tints":{"type":"array","items":{"type":"string"}},"shades":{"type":"array","items":{"type":"string"}},"triadic":{"type":"array","items":{"type":"string"}},"analogous":{"type":"array","items":{"type":"string"}},"luminance":{"type":"number","description":"WCAG relative luminance 0-1 (op=convert)."},"complementary":{"type":"string","description":"(op=palette)."}},"description":"Shape depends on `op`."}}}}},"responseSchema":null,"example":null,"exampleRequest":null,"tags":["x402"],"displayCostAmount":"0.001","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.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_QDHtVLDP8fL2TwnFujbeM","protocol":"x402","methodType":"crypto","chain":"base","mode":"charge","costAmount":"0.001","costPer":"request","priority":0,"asset":"0x833589fCD6eDb6E08f4c7C32D4f71b54bdA02913","unit":"request","depositMicros":null,"planRef":null}],"brandName":null,"brandSlug":null,"brandBaseUrl":null,"brandDocsUrl":null,"whatItDoes":"Converts colors between formats, computes WCAG accessibility contrast ratios, and derives color palettes from a given color","exampleAgentPrompt":"Check if my text color #1a1a2e on background #f0f0f0 passes WCAG 2.x AA and AAA accessibility standards for both normal and large text, and also tell me the contrast ratio.","exampleUseCases":null,"resultDescription":"Depending on the operation: (convert) hex, rgb, hsl, hsv, alpha, relative luminance (0-1), and exact CSS name if one exists; (contrast) WCAG contrast ratio (1-21), and AA/AAA pass/fail booleans for normal text, large text, and UI components; (palette) hex strings for complementary, analogous, triadic colors, plus arrays of tints and shades.","failureModes":["Invalid or unrecognized color format returns an error","Missing required color parameter returns an error","Missing fg or bg when op=contrast returns an error","Malformed hex string (e.g. including '#') may fail — hex must be sent without '#'","Unsupported op value returns an error"],"whenToPreferThis":"Use this endpoint when you need color format conversion, WCAG accessibility contrast checking (AA/AAA compliance), or palette generation in a single lightweight paid API call. Prefer it over client-side libraries when you need a backend or agent-accessible computation, or when you want authoritative WCAG 2.x pass/fail verdicts including UI component thresholds. Well-suited for design tools, accessibility auditing, and automated UI checks.","instructions":null,"reviewSummary":null,"reviewSummaryHighlights":null,"reviewSummaryConcerns":null,"reviewSummaryGeneratedAt":null,"activationCount":0,"lastUsedAt":null,"lastSuccessfullyRanAt":null,"lastHealthCheckAt":"2026-09-15T00:43:32.614Z","isFirstParty":false}