---
title: "swatch.editGroup: Edit Color Group — Vector kit command — Kition"
description: "Rewrites a colour group's colours in order (adding or removing swatches as needed) and optionally renames it."
canonical: "https://developer.kition.ai/docs/kits/vector/commands/swatch.editGroup"
---

> Canonical HTML: [https://developer.kition.ai/docs/kits/vector/commands/swatch.editGroup](https://developer.kition.ai/docs/kits/vector/commands/swatch.editGroup)

# swatch.editGroup

**Edit Color Group.** Rewrites a colour group's colours in order (adding or removing swatches as needed) and optionally renames it.

- Kit: Vector 0.1.0 (.kvector); reference: [Vector kit commands](https://developer.kition.ai/docs/kits/vector.md)
- Changes the document: yes

## Parameters

| Name | Type | Required | Description |
| --- | --- | --- | --- |
| `colors` | `string[]` | no | hex, key, {c,m,y,k} or {l,a,b}; the group's swatches take them in order, extra colours become new swatches, swatches past the end are removed; built-in swatches can't change |
| `group` | `string` | no |  |
| `ids` | `any[]` | no | read by the command beside its listed parameters |
| `rename` | `string` | no |  |

## Call through vector_run

```text
vector_run {
  "path": "<file>.kvector",
  "steps": [{ "command": "swatch.editGroup" }]
}
```

The required parameters, with placeholders for their types: not a tested example. Optional: `colors`, `group`, `ids`, `rename`. vector_run answers the step’s result in `completed[i].result`.

## Result

The kit gives no result schema for this command.

## Parameter schema

```json
{
  "additionalProperties": false,
  "properties": {
    "colors": {
      "description": "hex, key, {c,m,y,k} or {l,a,b}; the group's swatches take them in order, extra colours become new swatches, swatches past the end are removed; built-in swatches can't change",
      "items": {
        "description": "a colour such as #rrggbb",
        "type": "string"
      },
      "type": "array"
    },
    "group": {
      "type": "string",
      "x-khp-name": "name",
      "x-khp-types": [
        "SwatchGroup"
      ]
    },
    "ids": {
      "description": "read by the command beside its listed parameters",
      "type": "array"
    },
    "rename": {
      "type": "string"
    }
  },
  "returns": "{name, swatches: [names], relinked}",
  "type": "object"
}
```

Generated from the command list of @kition/vector-darwin-arm64@0.1.0 and the kit itself (vector_commands through @kition/cli@0.1.1, built from KitionAI/kition-vector@7cf908f).
