Photo kit command

layer.new.artboard

Artboard…

Adds an artboard named `name` at `rect` or of a `preset` size, with a `background`; answers its id.

Kit
Photo 0.1.0 (PSD, PSB, or .kphoto)
Changes the document
yes

Parameters

Parameters of layer.new.artboard
NameTypeRequiredDescription
background"white" | "black" | "transparent" | "custom"no
coalescestringnoMerges consecutive edits with the same key into one undo step, as a slider drag or a typing session is one.
colorstring | number[] | objectno[r,g,b]|"#rrggbb"? (custom); custom
heightnumbernodefault: canvas size, right of the last board
namestringno
presetstringnofor example iPhone 14, Web 1920, A4
rectnumber[]no[x,y,w,h]? | "x"
widthnumberno
xintegernoThe artboard's left edge, in pixels.
ynumberno

Call through photo_run

text
photo_run {
  "path": "<file>.psd",
  "steps": [{ "command": "layer.new.artboard" }]
}

The required parameters, with placeholders for their types: not a tested example. Optional: background, coalesce, color, height, name, preset, rect, width, x, y. photo_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": {
    "background": {
      "default": "white",
      "enum": [
        "white",
        "black",
        "transparent",
        "custom"
      ],
      "type": "string"
    },
    "coalesce": {
      "description": "Merges consecutive edits with the same key into one undo step, as a slider drag or a typing session is one.",
      "type": "string"
    },
    "color": {
      "description": "[r,g,b]|\"#rrggbb\"? (custom); custom",
      "oneOf": [
        {
          "type": "string"
        },
        {
          "items": {
            "type": "number"
          },
          "type": "array"
        },
        {
          "additionalProperties": true,
          "type": "object"
        }
      ]
    },
    "height": {
      "description": "default: canvas size, right of the last board",
      "type": "number"
    },
    "name": {
      "type": "string"
    },
    "preset": {
      "description": "for example iPhone 14, Web 1920, A4",
      "type": "string"
    },
    "rect": {
      "description": "[x,y,w,h]? | \"x\"",
      "items": {
        "type": "number"
      },
      "type": "array"
    },
    "width": {
      "type": "number"
    },
    "x": {
      "description": "The artboard's left edge, in pixels.",
      "type": "integer"
    },
    "y": {
      "type": "number"
    }
  },
  "returns": "{layer, rect}",
  "type": "object"
}

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