---
title: "swatch.newGroup: New Color Group — Vector kit command — Kition"
description: "Creates a colour group from existing swatches, new colours or the selected art's colours."
canonical: "https://developer.kition.ai/docs/kits/vector/commands/swatch.newGroup"
---

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

# swatch.newGroup

**New Color Group.** Creates a colour group from existing swatches, new colours or the selected art's colours.

- 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 | added as new swatches |
| `fromArtwork` | `boolean` | no | add the unique colours of the selected art: fills, strokes, text, gradient stops and mesh points; a colour linked to a global swatch moves that swatch into the group |
| `includeTints` | `boolean` | no | with fromArtwork: tints of global swatches also get swatches of their own |
| `name` | `string` | no |  |
| `swatches` | `any[]` | no | [names] (solid colours move into the group; gradients, patterns and None stay); solid colours move into the group; gradients, patterns and None stay |
| `toGlobal` | `boolean` | no | with fromArtwork: the new swatches are global and the selected art's matching unlinked colours link to them |

## Call through vector_run

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

The required parameters, with placeholders for their types: not a tested example. Optional: `colors`, `fromArtwork`, `includeTints`, `name`, `swatches`, `toGlobal`. 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": "added as new swatches",
      "items": {
        "description": "a colour such as #rrggbb",
        "type": "string"
      },
      "type": "array"
    },
    "fromArtwork": {
      "default": false,
      "description": "add the unique colours of the selected art: fills, strokes, text, gradient stops and mesh points; a colour linked to a global swatch moves that swatch into the group",
      "type": "boolean"
    },
    "includeTints": {
      "default": false,
      "description": "with fromArtwork: tints of global swatches also get swatches of their own",
      "type": "boolean"
    },
    "name": {
      "type": "string"
    },
    "swatches": {
      "description": "[names] (solid colours move into the group; gradients, patterns and None stay); solid colours move into the group; gradients, patterns and None stay",
      "items": {},
      "type": "array",
      "x-khp-name": "name",
      "x-khp-types": [
        "Swatch"
      ]
    },
    "toGlobal": {
      "default": true,
      "description": "with fromArtwork: the new swatches are global and the selected art's matching unlinked colours link to them",
      "type": "boolean"
    }
  },
  "returns": "{name, swatches: [names in the group], linked: paints linked}",
  "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).
