Convert a color and check contrast
convert_colorConvert HEX, RGB, HSL, OKLCH, or CMYK into every format, name the nearest Tailwind token, and report the WCAG 2 contrast ratio against a background.
Tool call template
Replace each placeholder with a value matching the input schema. Only required parameters are included; add optional parameters as needed.
{
"id": 1,
"jsonrpc": "2.0",
"method": "tools/call",
"params": {
"arguments": {
"color": "<color>"
},
"name": "convert_color"
}
}Input Schema
| Name | Required | Description | Default |
|---|---|---|---|
| color | Yes | HEX, rgb(), hsl(), oklch(), cmyk(), or a CSS color name. | |
| background | No | Background used for the WCAG contrast ratio. | #ffffff |
Output Schema
| Name | Required | Description | Default |
|---|---|---|---|
| ok | Yes | ||
| hex | Yes | ||
| hsl | Yes | ||
| rgb | Yes | ||
| cmyk | Yes | ||
| oklch | Yes | ||
| aaLarge | Yes | ||
| aaNormal | Yes | ||
| aaaLarge | Yes | ||
| tailwind | Yes | ||
| aaaNormal | Yes | ||
| contrastText | Yes | ||
| contrastRatio | Yes |