---
title: "paint.gradient: Gradient — Scene kit command — Kition"
description: "Fills group `group` (the paint group without it) with a `kind` linear or radial gradient from viewport pixel `from` (full brush weight) to `to`, as one undo step."
canonical: "https://developer.kition.ai/docs/kits/scene/commands/paint.gradient"
---

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

# paint.gradient

**Gradient.** Fills group `group` (the paint group without it) with a `kind` linear or radial gradient from viewport pixel `from` (full brush weight) to `to`, as one undo step.

- Kit: Scene 0.1.0 (.kscene); reference: [Scene kit commands](https://developer.kition.ai/docs/kits/scene.md)
- Changes the document: yes

## Parameters

| Name | Type | Required | Description |
| --- | --- | --- | --- |
| `from` | `number[]` | yes | Where the full weight is, viewport pixels [x, y] |
| `group` | `string` | no | The group; the paint group when left out |
| `kind` | `"linear" \| "radial"` | no | Along the line, or around the start (linear) |
| `to` | `number[]` | yes | Where it has faded out, viewport pixels [x, y] |

## Call through scene_run

```text
scene_run {
  "path": "<file>.kscene",
  "steps": [{ "command": "paint.gradient", "params": { "from": <number[]>, "to": <number[]> } }]
}
```

The required parameters, with placeholders for their types: not a tested example. Optional: `group`, `kind`. scene_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": {
    "from": {
      "description": "Where the full weight is, viewport pixels [x, y]",
      "items": {
        "type": "number"
      },
      "type": "array"
    },
    "group": {
      "description": "The group; the paint group when left out",
      "type": "string"
    },
    "kind": {
      "description": "Along the line, or around the start (linear)",
      "enum": [
        "linear",
        "radial"
      ],
      "type": "string"
    },
    "to": {
      "description": "Where it has faded out, viewport pixels [x, y]",
      "items": {
        "type": "number"
      },
      "type": "array"
    }
  },
  "required": [
    "from",
    "to"
  ],
  "type": "object"
}
```

Generated from the command list of @kition/scene-darwin-arm64@0.1.0 and the kit itself (scene_commands through @kition/cli@0.1.1, built from KitionAI/kition-scene@4d06faf).
