Convert a color
convert_colorConvert colors between formats such as hex, RGB, HSL, OKLCH, CMYK, Display P3, and platform code (SwiftUI, UIKit, Flutter, Android).
Instructions
Convert a color between formats: hex, rgb, hsl, hsv, hwb, cmyk, lab, lch, oklab, oklch, display-p3, rec2020, xyz and platform code (swiftui, uikit, flutter, android). Values follow CSS Color 4.
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 | Any color: #ff5733, rgb(255 87 51), hsl(11 100% 60%), oklch(68% 0.21 34), a CSS or common name like navy, or a Tailwind class like sky-500 | |
| formats | No | Formats to return. Defaults to hex, rgb, hsl, oklch, oklab and display-p3 |