Convert a CSS color
convert_colorConvert a CSS color to hex, rgb() and hsl(), with its relative luminance, its contrast on white and on black, and the better text color (black or white) to put on it. Read-only. Same engine as GET /api/convert.
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 | Color as a CSS color: "#1a73e8", "#fff", "rgb(26 115 232)", "hsl(217 80% 51%)", "rgba(0,0,0,.6)" or a name like "navy". |
Output Schema
| Name | Required | Description | Default |
|---|---|---|---|
| hex | Yes | ||
| hsl | No | ||
| rgb | No | ||
| alpha | No | ||
| input | No | ||
| version | Yes | ||
| luminance | Yes | ||
| bestTextColor | Yes | ||
| contrastOnBlack | No | ||
| contrastOnWhite | No |