---
title: "color.convert: Convert Color — Layout kit command — Kition"
description: "Converts a colour between RGB, CMYK and gray with the working profiles; changes nothing."
canonical: "https://developer.kition.ai/docs/kits/layout/commands/color.convert"
---

> Canonical HTML: [https://developer.kition.ai/docs/kits/layout/commands/color.convert](https://developer.kition.ai/docs/kits/layout/commands/color.convert)

# color.convert

**Convert Color.** Converts a colour between RGB, CMYK and gray with the working profiles; changes nothing.

- Kit: Layout 0.1.0 (.klayout); reference: [Layout kit commands](https://developer.kition.ai/docs/kits/layout.md)
- Changes the document: no

## Parameters

| Name | Type | Required | Description |
| --- | --- | --- | --- |
| `color` | `object` | no | {model: rgb, r, g, b} or {model: cmyk, c, m, y, k} |
| `to` | `"rgb" \| "cmyk" \| "gray" \| "lab"` | no |  |

## Call through layout_run

```text
layout_run {
  "path": "<file>.klayout",
  "steps": [{ "command": "color.convert" }]
}
```

The required parameters, with placeholders for their types: not a tested example. Optional: `color`, `to`. layout_run answers the step’s result in `completed[i].result`.

## Result

| Name | Type | Required | Description |
| --- | --- | --- | --- |
| `c` | `number` | no |  |
| `k` | `number` | no |  |
| `m` | `number` | no |  |
| `model` | `string` | no |  |
| `y` | `number` | no |  |

```json
{
  "additionalProperties": true,
  "properties": {
    "c": {
      "type": "number"
    },
    "k": {
      "type": "number"
    },
    "m": {
      "type": "number"
    },
    "model": {
      "type": "string"
    },
    "y": {
      "type": "number"
    }
  },
  "type": "object"
}
```

## Parameter schema

```json
{
  "additionalProperties": false,
  "properties": {
    "color": {
      "additionalProperties": true,
      "description": "{model: rgb, r, g, b} or {model: cmyk, c, m, y, k}",
      "type": "object"
    },
    "to": {
      "enum": [
        "rgb",
        "cmyk",
        "gray",
        "lab"
      ],
      "type": "string"
    }
  },
  "type": "object"
}
```

Generated from the command list of @kition/layout-darwin-arm64@0.1.0 and the kit itself (layout_commands through @kition/cli@0.1.1, built from KitionAI/kition-layout@8767a18).
