Vector kit command

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)
Changes the document
yes

Parameters

Parameters of swatch.newGroup
NameTypeRequiredDescription
colorsstring[]noadded as new swatches
fromArtworkbooleannoadd 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
includeTintsbooleannowith fromArtwork: tints of global swatches also get swatches of their own
namestringno
swatchesany[]no[names] (solid colours move into the group; gradients, patterns and None stay); solid colours move into the group; gradients, patterns and None stay
toGlobalbooleannowith 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/[email protected] and the kit itself (vector_commands through @kition/[email protected], built from KitionAI/kition-vector@7cf908f). As data: commands.jsonl.