# WCAG Contrast Fix — Adjust Text Color Lightness to Meet Contrast Target

> WCAG Contrast Fix — Adjust Text Color Lightness to Meet Contrast Target is a paid API for AI agents from color-design.x402tookit.com, paid per call via x402, $0.02/call, status unknown (last checked 2026-10-29).

Adjusts a text color's lightness to reach a specified WCAG contrast ratio (3, 4.5, or 7) against a given background, preserving its original hue.

## Facts

- Endpoint: GET https://color-design.x402tookit.com/contrast-fix?utm_source=zero.xyz
- Price: $0.02/call
- Payment: x402
- Status: unknown
- Last checked: 2026-10-29
- Activations on Zero: 0
- Tags: x402
- Canonical page: https://www.zero.xyz/c/wcag-contrast-fix-adjust-text-color-lightness-to-meet-contrast-target-87f461d6
- Structured record (JSON): https://api.zero.xyz/v1/capabilities/cap_FiTmnaq7V6yHoPXI3ehUq

Status and success rate cover calls made through Zero and Zero's own probes. Third-party monitors may report differently.

## How to call it through Zero

Zero handles the 402 payment challenge and records the run. With the Zero CLI installed (`npm i -g @zeroxyz/cli`):

```sh
zero fetch --capability wcag-contrast-fix-adjust-text-color-lightness-to-meet-contrast-target-87f461d6
```

Example prompt: My text is #3a6bcf on a #ffffff background and it's failing accessibility — can you adjust its lightness just enough to hit a 4.5:1 WCAG contrast ratio while keeping the same blue hue?

## When to prefer this

Choose this endpoint when you need a minimal, hue-preserving correction to a text color to meet a specific WCAG contrast threshold — not a full palette regen, color picker, or generic contrast checker. Ideal for automated accessibility remediation pipelines where brand hue must be preserved and only lightness should change.

## Known failure modes

- Invalid hex format for foreground or background returns an error
- Contrast target not 3, 4.5, or 7 may be rejected or defaulted
- Color may already pass — fixed value equals original with contrastBefore >= target
- If no lightness adjustment can reach the target (e.g. pure hue limits), degraded flag may be set
- Missing required foreground or background parameters returns a validation error

## How this service works

Adjust a text color's lightness just enough to reach a WCAG contrast target (4.5, 3 or 7) on a background, keeping its hue.

## Output

Returns the original and corrected foreground hex, contrast ratios before and after the fix, lightness shift applied, the WCAG target used, a verdict on compliance, a human-readable summary, reasons for any adjustments, and flags for degraded or unchecked conditions.

## Request schema (JSON Schema)

```json
{
 "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": [
      "foreground",
      "background"
     ],
     "properties": {
      "target": {
       "type": "number",
       "description": "Contrast target: 3, 4.5 (default) or 7"
      },
      "background": {
       "type": "string",
       "description": "Background hex"
      },
      "foreground": {
       "type": "string",
       "description": "Text color hex"
      }
     }
    }
   },
   "additionalProperties": false
  },
  "output": {
   "type": "object",
   "required": [
    "type"
   ],
   "properties": {
    "type": {
     "type": "string"
    },
    "example": {
     "type": "object",
     "properties": {
      "asOf": {
       "type": [
        "null",
        "string"
       ]
      },
      "fixed": {
       "type": [
        "null",
        "string"
       ]
      },
      "source": {
       "type": [
        "null",
        "string"
       ]
      },
      "target": {
       "type": [
        "null",
        "number"
       ]
      },
      "reasons": {
       "type": [
        "array",
        "null"
       ],
       "items": {
        "type": "string"
       }
      },
      "summary": {
       "type": [
        "null",
        "string"
       ]
      },
      "verdict": {
       "type": [
        "null",
        "string"
       ]
      },
      "degraded": {
       "type": [
        "boolean",
        "null"
       ]
      },
      "original": {
       "type": [
        "null",
        "string"
       ]
      },
      "background": {
       "type": [
        "null",
        "string"
       ]
      },
      "disclaimer": {
       "type": [
        "null",
        "string"
       ]
      },
      "notChecked": {
       "type": [
        "array",
        "null"
       ],
       "items": {
        "type": "string"
       }
      },
      "contrastAfter": {
       "type": [
        "null",
        "number"
       ]
      },
      "contrastBefore": {
       "type": [
        "null",
        "number"
       ]
      },
      "lightnessShift": {
       "type": [
        "null",
        "number"
       ]
      }
     }
   
… (truncated)
```

## More

- Live health (JSON, refreshed every minute): https://www.zero.xyz/c/wcag-contrast-fix-adjust-text-color-lightness-to-meet-contrast-target-87f461d6/health.json
- [Zero catalog index](https://www.zero.xyz/llms.txt)
- [Other services from color-design.x402tookit.com](https://www.zero.xyz/host/color-design.x402tookit.com/llms.txt)
