Convert color
convert_colorConvert a color between notations: HEX, RGB, HSL, HSV, HWB, CMYK, CIE Lab and LCH, OKLab, OKLCH, Display P3, YCbCr, Android, Flutter, SwiftUI, UIKit, decimal and more, plus the nearest CSS color name. Accepts most written forms, for example #3b82f6, rgb(59 130 246), 59, 130, 246, hsl(217 91% 60%), cmyk(76%, 47%, 0%, 4%), oklch(0.62 0.19 260), 0xFF3B82F6 or a CSS name. Colors outside sRGB keep exact values in wide-gamut notations and get the nearest color in sRGB ones.
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": {
"color": "<color>"
},
"name": "convert_color"
}
}Input Schema
| Name | Required | Description | Default |
|---|---|---|---|
| color | Yes | The color to convert, for example #3b82f6. | |
| locale | No | Language of the returned tool page link and of the text rules, one of: pl, en, de, es, fr, pt, it, cs, ar, id, tr, el, uk, ro, th, ja, vi, hi. Defaults to en. | |
| notations | No | Notations to return. Default: hex, rgb, hsl, hsv, hwb, cmyk, lab, lch, oklch and name. |