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
| Name | Type | Required | Description |
|---|---|---|---|
color | string | no | #rrggbb, or CMYK as {c,m,y,k} from 0 to 100 |
gradient | object | no | a gradient swatch's {kind: linear|radial, stops: [{location: 0 to 100, color, midpoint: 13 to 87}]} |
name | string | no | |
rename | string | no | the new name (every use follows) |
spot | boolean | no | |
tint | number | no | 0 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.