Layout kit command

swatch.set

Swatch Options

Changes a swatch's name, colour, process or spot, a tint swatch's tint, or a gradient swatch's kind and stops; everything using it follows.

Kit
Layout 0.1.0 (.klayout)
Changes the document
yes

Parameters

Parameters of swatch.set
NameTypeRequiredDescription
colorstringno#rrggbb, or CMYK as {c,m,y,k} from 0 to 100
gradientobjectnoa gradient swatch's {kind: linear|radial, stops: [{location: 0 to 100, color, midpoint: 13 to 87}]}
namestringno
renamestringnothe new name (every use follows)
spotbooleanno
tintnumberno0 to 1, a tint swatch's tint

Call through layout_run

text
layout_run {
  "path": "<file>.klayout",
  "steps": [{ "command": "swatch.set" }]
}

The required parameters, with placeholders for their types: not a tested example. Optional: color, gradient, name, rename, spot, tint. layout_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": {
    "color": {
      "description": "#rrggbb, or CMYK as {c,m,y,k} from 0 to 100",
      "type": "string"
    },
    "gradient": {
      "description": "a gradient swatch's {kind: linear|radial, stops: [{location: 0 to 100, color, midpoint: 13 to 87}]}",
      "type": "object"
    },
    "name": {
      "type": "string",
      "x-khp-name": "name",
      "x-khp-types": [
        "Swatch"
      ]
    },
    "rename": {
      "description": "the new name (every use follows)",
      "type": "string"
    },
    "spot": {
      "type": "boolean"
    },
    "tint": {
      "description": "0 to 1, a tint swatch's tint",
      "type": "number"
    }
  },
  "type": "object"
}

Generated from the command list of @kition/[email protected] and the kit itself (layout_commands through @kition/[email protected], built from KitionAI/kition-layout@8767a18). As data: commands.jsonl.