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.
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 |