parse_color
Parses CSS color strings to extract hex, RGB, OKLCH, and gamut information. Converts any valid CSS color input into structured color data for further processing.
Instructions
Parse a CSS color string and return hex, rgb, oklch, and gamut info.
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>"
},
"name": "parse_color"
}
}Input Schema
| Name | Required | Description | Default |
|---|---|---|---|
| input | Yes | CSS color string, e.g. "tomato", "#ff6347", "oklch(0.6 0.18 27)" (max 256 chars) |
Output Schema
| Name | Required | Description | Default |
|---|---|---|---|
| hex | Yes | Lowercase #rrggbb sRGB-clamped hex of the parsed color | |
| rgb | Yes | sRGB-clamped 0-255 integer channels; see inGamut | |
| oklch | Yes | Raw (lossless) OKLCH components of the parsed color | |
| inGamut | Yes | false when the input fell outside the sRGB gamut |