# Color Converter and Contrast (`convert.color`)

Convert a colour between hex, RGB and HSL, and compute the WCAG contrast ratio against a second colour with AA/AAA verdicts.

- **Route:** `POST /v1/run/convert.color`
- **Price:** $0.0002 per request ($0.20 per 1,000) · `cost_usd` on every response
- **Source:** GetAllAPIs compute (`compute`) · failover: no
- **Measured latency:** p50 2 ms · p95 2 ms · p99 2 ms (1 calls, 30d)
- **Heavy response:** no

## Input

| Field | Type | Required | Default | Notes |
|---|---|---|---|---|
| `color` | string | yes |  | Colour as #rrggbb, rgb(), hsl() or a basic name |
| `against` | string | no | "#ffffff" | Second colour for the contrast check |

## Output (`output` in the run envelope)

| Field | Meaning |
|---|---|
| `hex` | Hex value. |
| `rgb` | Red, green, blue 0-255. |
| `hsl` | Hue 0-360, saturation and lightness in percent. |
| `luminance` | WCAG relative luminance. |
| `contrast` | Contrast ratio against the second colour and WCAG 2 pass/fail for normal and large text. |

## Example

```bash
curl -s -X POST https://getallapis.com/v1/run/convert.color \
  -H "Authorization: Bearer $GETALLAPIS_API_KEY" \
  -H "Content-Type: application/json" \
  -d '{"color":"#0b63ce","against":"#ffffff"}'
```

```python
from getallapis_client import Client
client = Client()  # reads GETALLAPIS_API_KEY
result = client.run('convert.color', {'color': '#0b63ce', 'against': '#ffffff'})
print(result['cost_usd'], result['output'])
```

```bash
getallapis run convert.color '{"color":"#0b63ce","against":"#ffffff"}'
```

Quote first (free, validates input): `POST /v1/quote/convert.color` with the same body.
