conversion_color_code
Convert a single color string between HEX, RGB, HSL, and HSV formats, returning all four representations at once along with normalized channel values. Accepts hex, rgb, hsl, hsv, and CSS color names.
Instructions
Color Code Converter. Convert a single color string between HEX, RGB, HSL, and HSV, returning all four representations at once plus normalized channel values. Accepts hex (#RGB or #RRGGBB), rgb()/comma-triple, hsl(), hsv(), and 140+ CSS color names; the inputFormat argument names the expected source notation but a CSS color name is always tried as a fallback. Use webdev_hex_color instead when you want richer single-color analysis (CMYK, harmony palettes, WCAG contrast), or webdev_color_palette when you only want harmony schemes. Runs locally on the input you provide: read-only, non-destructive, contacts no external service, and is rate-limited (60 requests/min anonymous). Returns the color formatted as HEX, short HEX, RGB, HSL, and HSV strings, a preview hex, and r/g/b, h/s/l, h/sv/v, and brightness values.
Input Schema
| Name | Required | Description | Default |
|---|---|---|---|
| input | Yes | The color to convert. Format must match inputFormat: hex is #RGB/#RRGGBB, rgb is rgb(255,0,0) or a bare 255,0,0 triple, hsl is hsl(210,80%,60%) or 210,80,60, hsv is hsv(210,80%,60%) or 210,80,60. A CSS color name (red, teal, etc.) is accepted in any mode. Whitespace and case are ignored. Invalid input returns HTTP 400. | |
| inputFormat | No | The expected source notation of input. Determines which parser runs first; a CSS color name is tried as a fallback regardless. | hex |
Output Schema
| Name | Required | Description | Default |
|---|---|---|---|
| success | No | Whether the conversion succeeded. | |
| result | No | The color expressed in every supported format. |