convert_color
Pack: colorapi · Endpoint: https://gateway.pipeworx.io/colorapi/mcp
Convert between color formats: RGB to hex, HSL, HSV, CMYK. Returns the closest named color for the input values.
Parameters
| Name | Type | Required | Description |
|---|---|---|---|
r | number | yes | Red channel (0-255). |
g | number | yes | Green channel (0-255). |
b | number | yes | Blue channel (0-255). |
Example call
Arguments
{
"r": 255,
"g": 87,
"b": 51
}
curl
curl -X POST https://gateway.pipeworx.io/colorapi/mcp \
-H 'Content-Type: application/json' \
-d '{"jsonrpc":"2.0","id":1,"method":"tools/call","params":{"name":"convert_color","arguments":{"r":255,"g":87,"b":51}}}'
TypeScript (@pipeworx/sdk)
import { Pipeworx } from '@pipeworx/sdk';
const pipeworx = new Pipeworx();
const result = await pipeworx.call('convert_color', {
"r": 255,
"g": 87,
"b": 51
});
More examples
{
"r": 52,
"g": 152,
"b": 219
}
Response shape
Always returns: name, exact_name_match, closest_named_hex, hex, rgb, hsl, hsv, cmyk, contrast
| Field | Type | Description |
|---|---|---|
name | string | Common color name |
exact_name_match | boolean | Whether the name is an exact match |
closest_named_hex | string | Hex code of closest named color |
hex | string | Hex color value |
rgb | string | RGB color format string |
hsl | string | HSL color format string |
hsv | string | HSV color format string |
cmyk | string | CMYK color format string |
contrast | string | WCAG contrast ratio value |
Full JSON Schema
{
"type": "object",
"properties": {
"name": {
"type": "string",
"description": "Common color name"
},
"exact_name_match": {
"type": "boolean",
"description": "Whether the name is an exact match"
},
"closest_named_hex": {
"type": "string",
"description": "Hex code of closest named color"
},
"hex": {
"type": "string",
"description": "Hex color value"
},
"rgb": {
"type": "string",
"description": "RGB color format string"
},
"hsl": {
"type": "string",
"description": "HSL color format string"
},
"hsv": {
"type": "string",
"description": "HSV color format string"
},
"cmyk": {
"type": "string",
"description": "CMYK color format string"
},
"contrast": {
"type": "string",
"description": "WCAG contrast ratio value"
}
},
"required": [
"name",
"exact_name_match",
"closest_named_hex",
"hex",
"rgb",
"hsl",
"hsv",
"cmyk",
"contrast"
]
}
Connect
Add this to your MCP client config, or use one-click install buttons:
{
"mcpServers": {
"colorapi": {
"url": "https://gateway.pipeworx.io/colorapi/mcp"
}
}
}
See Getting Started for client-specific install steps.