Vector kit command

recolor.apply

Recolor Artwork

Recolours the selection in one undo step by a map of colour rows (from keys or hex to a new colour), with a tint method, an optional swatch library to snap to and a colour group to rewrite.

Kit
Vector 0.1.0 (.kvector)
Changes the document
yes

Parameters

Parameters of recolor.apply
NameTypeRequiredDescription
groupstringno
groupColorsstring[]nodefault: the rows' new colours, in order, excluded rows left out
includeImagesbooleanno
includePatternsbooleanno
limitTostringno
mapobject[] | objectno
method"exact" | "preserveTints" | "scaleTints" | "tintsShades" | "hueShift"nodefault; how a row's colours take its new colour, relative to the row's darkest, average or most saturated colour
renamestringno

Call through vector_run

text
vector_run {
  "path": "<file>.kvector",
  "steps": [{ "command": "recolor.apply" }]
}

The required parameters, with placeholders for their types: not a tested example. Optional: group, groupColors, includeImages, includePatterns, limitTo, map, method, 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": {
    "group": {
      "type": "string",
      "x-khp-name": "name",
      "x-khp-types": [
        "SwatchGroup"
      ]
    },
    "groupColors": {
      "description": "default: the rows' new colours, in order, excluded rows left out",
      "items": {
        "description": "a colour such as #rrggbb",
        "type": "string"
      },
      "type": "array"
    },
    "includeImages": {
      "default": true,
      "type": "boolean"
    },
    "includePatterns": {
      "default": true,
      "type": "boolean"
    },
    "limitTo": {
      "type": "string"
    },
    "map": {
      "oneOf": [
        {
          "items": {
            "additionalProperties": true,
            "type": "object"
          },
          "type": "array"
        },
        {
          "additionalProperties": true,
          "type": "object"
        }
      ]
    },
    "method": {
      "description": "default; how a row's colours take its new colour, relative to the row's darkest, average or most saturated colour",
      "enum": [
        "exact",
        "preserveTints",
        "scaleTints",
        "tintsShades",
        "hueShift"
      ],
      "type": "string"
    },
    "rename": {
      "type": "string"
    }
  },
  "returns": "{changed}",
  "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.