---
title: "paint.setFill: Fill — Vector kit command — Kition"
description: "Sets the fill of the selection or ids (or the default fill) to a colour, a swatch, a gradient, a pattern or none; a global or spot swatch stays linked."
canonical: "https://developer.kition.ai/docs/kits/vector/commands/paint.setFill"
---

> Canonical HTML: [https://developer.kition.ai/docs/kits/vector/commands/paint.setFill](https://developer.kition.ai/docs/kits/vector/commands/paint.setFill)

# paint.setFill

**Fill.** Sets the fill of the selection or ids (or the default fill) to a colour, a swatch, a gradient, a pattern or none; a global or spot swatch stays linked.

- Kit: Vector 0.1.0 (.kvector); reference: [Vector kit commands](https://developer.kition.ai/docs/kits/vector.md)
- Changes the document: yes
- Acts on: `ids` (a list of ids), which a run step’s `on` fills

## Parameters

| Name | Type | Required | Description |
| --- | --- | --- | --- |
| `color` | `string \| number[] \| object` | no |  |
| `focus` | `boolean` | no | false keeps the active proxy |
| `gradient` | `object` | no | {kind?: linear\|radial\|freeform, stops?: [{offset 0..1, color, opacity? 0..1 (or 0..100), midpoint? 0.13..0.87, swatch?: global or spot colour (or tint) swatch the stop links to (its colour comes from the swatch), tint?: 0..100}] (at least 2; default white→black), angle?: deg, start?: [x,y], end?: [x,y] (the vector in document coordinates, both or neither; type objects keep it in text space), aspect?: % (radial; without start/end the gradient is placed on each object's bounds), focal?: [x,y] (radial, with start/end: the focal point, where the first stop sits), swatch?: linked gradient swatch name}; or 0..100; or tint; its colour comes from the swatch; at least 2; default white→black; the vector in document coordinates, both or neither; type objects keep it in text space; radial; without start/end the gradient is placed on each object's bounds; radial, with start/end: the focal point, where the first stop sits |
| `id` | `integer` | no | object ID |
| `ids` | `integer[]` | no | object IDs |
| `item` | `integer \| null` | no |  |
| `keepModel` | `boolean` | no | in a CMYK document, RGB colours and gradient stops are stored as CMYK unless true; Gray stays Gray |
| `none` | `boolean` | no |  |
| `paint` | `object` | no | read by the command beside its listed parameters |
| `swatch` | `string` | no | a global or spot colour stays linked, so swatch edits recolour it; a tint swatch links to its base at its tint; a gradient swatch is recorded as the gradient's swatch and fits each object, keeping its aspect; the built-in "[Registration]" prints on every plate |
| `target` | `string` | no | "object" (default) or "contents": the objects themselves, or what their groups and layers hold |
| `tint` | `integer` | no | 0 to 100; % of a global or spot `swatch`; default 100, or a tint swatch's own |

## Call through vector_run

```text
vector_run {
  "path": "<file>.kvector",
  "steps": [{ "command": "paint.setFill" }]
}
```

The required parameters, with placeholders for their types: not a tested example. Optional: `color`, `focus`, `gradient`, `id`, `ids`, `item`, `keepModel`, `none`, `paint`, `swatch`, `target`, `tint`. 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": {
    "color": {
      "oneOf": [
        {
          "type": "string"
        },
        {
          "items": {
            "type": "number"
          },
          "type": "array"
        },
        {
          "additionalProperties": true,
          "type": "object"
        }
      ]
    },
    "focus": {
      "default": true,
      "description": "false keeps the active proxy",
      "type": "boolean"
    },
    "gradient": {
      "additionalProperties": true,
      "description": "{kind?: linear|radial|freeform, stops?: [{offset 0..1, color, opacity? 0..1 (or 0..100), midpoint? 0.13..0.87, swatch?: global or spot colour (or tint) swatch the stop links to (its colour comes from the swatch), tint?: 0..100}] (at least 2; default white→black), angle?: deg, start?: [x,y], end?: [x,y] (the vector in document coordinates, both or neither; type objects keep it in text space), aspect?: % (radial; without start/end the gradient is placed on each object's bounds), focal?: [x,y] (radial, with start/end: the focal point, where the first stop sits), swatch?: linked gradient swatch name}; or 0..100; or tint; its colour comes from the swatch; at least 2; default white→black; the vector in document coordinates, both or neither; type objects keep it in text space; radial; without start/end the gradient is placed on each object's bounds; radial, with start/end: the focal point, where the first stop sits",
      "properties": {
        "angle": {
          "description": "degrees",
          "type": "number"
        },
        "aspect": {
          "description": "percent",
          "type": "number"
        },
        "end": {
          "items": {
            "type": "number"
          },
          "type": "array"
        },
        "focal": {
          "items": {
            "type": "number"
          },
          "type": "array"
        },
        "kind": {
          "enum": [
            "linear",
            "radial",
            "freeform"
          ],
          "type": "string"
        },
        "start": {
          "items": {
            "type": "number"
          },
          "type": "array"
        },
        "stops": {
          "description": "[{offset 0..1, color, opacity? 0..1 , midpoint? 0.13..0.87, swatch?: global or spot colour  swatch the stop links to , tint?: 0..100}]",
          "items": {
            "additionalProperties": true,
            "properties": {
              "color": {
                "type": "string"
              },
              "swatch": {
                "description": "global or spot colour  swatch the stop links to",
                "x-khp-name": "name",
                "x-khp-role": "object",
                "x-khp-types": [
                  "Swatch"
                ]
              },
              "tint": {
                "description": "0 to 100",
                "type": "integer"
              }
            },
            "type": "object"
          },
          "type": "array"
        },
        "swatch": {
          "description": "linked gradient swatch name",
          "x-khp-name": "name",
          "x-khp-role": "object",
          "x-khp-types": [
            "Swatch"
          ]
        }
      },
      "type": "object"
    },
    "id": {
      "description": "object ID",
      "type": "integer",
      "x-khp-types": [
        "Node"
      ]
    },
    "ids": {
      "description": "object IDs",
      "items": {
        "type": "integer"
      },
      "type": "array",
      "x-khp-types": [
        "Node"
      ]
    },
    "item": {
      "oneOf": [
        {
          "type": "integer"
        },
        {
          "type": "null"
        }
      ]
    },
    "keepModel": {
      "default": false,
      "description": "in a CMYK document, RGB colours and gradient stops are stored as CMYK unless true; Gray stays Gray",
      "type": "boolean"
    },
    "none": {
      "default": true,
      "type": "boolean"
    },
    "paint": {
      "additionalProperties": true,
      "description": "read by the command beside its listed parameters",
      "type": "object"
    },
    "swatch": {
      "description": "a global or spot colour stays linked, so swatch edits recolour it; a tint swatch links to its base at its tint; a gradient swatch is recorded as the gradient's swatch and fits each object, keeping its aspect; the built-in \"[Registration]\" prints on every plate",
      "type": "string",
      "x-khp-name": "name",
      "x-khp-types": [
        "Swatch",
        "Pattern"
      ]
    },
    "target": {
      "description": "\"object\" (default) or \"contents\": the objects themselves, or what their groups and layers hold",
      "type": "string"
    },
    "tint": {
      "description": "0 to 100; % of a global or spot `swatch`; default 100, or a tint swatch's own",
      "type": "integer"
    }
  },
  "returns": "black), angle?: deg, start?: [x,y], end?: [x,y] (the vector in document coordinates, both or neither; type objects keep it in text space), aspect?: % (radial; without start/end the gradient is placed on each object's bounds), focal?: [x,y] (radial, with start/end: the focal point, where the first stop sits), swatch?: linked gradient swatch name}, item?: appearance item index|null (omitted: the Appearance panel's active item if it is a fill, else the top fill), ids?, focus?: true (false keeps the active proxy), keepModel?: false (in a CMYK document, RGB colours and gradient stops are stored as CMYK unless true; Gray stays Gray)} sets the selection's fill and the default (new art fits a gradient to itself)",
  "type": "object"
}
```

Generated from the command list of @kition/vector-darwin-arm64@0.1.0 and the kit itself (vector_commands through @kition/cli@0.1.1, built from KitionAI/kition-vector@7cf908f).
