Convert a color
convert_colorConverts any CSS color into Tailwind-formatted oklch(), hex, and rgb values, mapping each into its correct gamut. Use for a single color; call generate_palette to build full shades.
Instructions
Converts any CSS color to oklch(), hex and rgb, formatted like Tailwind (oklch() is what Tailwind v4 uses). Colors outside a format are mapped into it: oklch() to Display P3 like Tailwind's palette, hex and rgb to sRGB. Use it for one value; to add a color with all its shades, call generate_palette instead.
Input Schema
| Name | Required | Description | Default |
|---|---|---|---|
| color | Yes | Any CSS color: hex (#db4d53), rgb(), hsl(), oklch() or a named color |
Output Schema
| Name | Required | Description | Default |
|---|---|---|---|
| hex | Yes | e.g. #db4d53 | |
| rgb | Yes | e.g. rgb(219, 77, 83) | |
| oklch | Yes | e.g. oklch(61.6% 0.177 21.62) |