convert_color
Convert colors between 22+ formats including HEX, RGB, HSL, CMYK, LAB, and framework-specific outputs for CSS, Swift, Android, and Flutter with configurable precision.
Instructions
Convert colors between different formats with high precision and comprehensive format support
Input Schema
Name | Required | Description | Default |
---|---|---|---|
color | Yes | Input color in any supported format (HEX, RGB, HSL, HSV, CMYK, LAB, XYZ, named colors, etc.) | |
output_format | Yes | Desired output format | |
precision | No | Number of decimal places for numeric values | |
variable_name | No | Variable name for CSS/SCSS variable formats (optional) |
Input Schema (JSON Schema)
{
"properties": {
"color": {
"description": "Input color in any supported format (HEX, RGB, HSL, HSV, CMYK, LAB, XYZ, named colors, etc.)",
"examples": [
"#FF0000",
"rgb(255, 0, 0)",
"hsl(0, 100%, 50%)",
"hsv(0, 100%, 100%)",
"cmyk(0%, 100%, 100%, 0%)",
"lab(53.23, 80.11, 67.22)",
"red",
"255, 0, 0"
],
"type": "string"
},
"output_format": {
"description": "Desired output format",
"enum": [
"hex",
"rgb",
"rgba",
"hsl",
"hsla",
"hsv",
"hsva",
"hwb",
"cmyk",
"lab",
"xyz",
"lch",
"oklab",
"oklch",
"css-var",
"scss-var",
"tailwind",
"swift",
"android",
"flutter",
"named"
],
"type": "string"
},
"precision": {
"default": 2,
"description": "Number of decimal places for numeric values",
"maximum": 10,
"minimum": 0,
"type": "number"
},
"variable_name": {
"description": "Variable name for CSS/SCSS variable formats (optional)",
"pattern": "^[a-zA-Z][a-zA-Z0-9-_]*$",
"type": "string"
}
},
"required": [
"color",
"output_format"
],
"type": "object"
}