convert_color
Convert any CSS color string to canonical hex, rgb, hsl, or oklch format. Provide input color and target format to get standardized output.
Instructions
Convert a CSS color string into a canonical hex, rgb, hsl, or oklch format string.
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": {
"input": "<input>",
"to": "<to>"
},
"name": "convert_color"
}
}Input Schema
| Name | Required | Description | Default |
|---|---|---|---|
| to | Yes | Target color format to convert the input into | |
| input | Yes | CSS color string to convert, e.g. "#ff0000", "tomato" (max 256 chars) |
Output Schema
| Name | Required | Description | Default |
|---|---|---|---|
| result | Yes | The input color formatted in the requested target format (oklch is raw/lossless; hex/rgb/hsl are sRGB-clamped for out-of-gamut inputs) |