---
title: "recolor.reduce: Reduce Colors — Vector kit command — Kition"
description: "Groups the selection's colours into a given number of rows of similar colours and answers the proposed map, without changing anything; pass the map to recolor.apply."
canonical: "https://developer.kition.ai/docs/kits/vector/commands/recolor.reduce"
---

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

# recolor.reduce

**Reduce Colors.** Groups the selection's colours into a given number of rows of similar colours and answers the proposed map, without changing anything; pass the map to recolor.apply.

- Kit: Vector 0.1.0 (.kvector); reference: [Vector kit commands](https://developer.kition.ai/docs/kits/vector.md)
- Changes the document: no

## Parameters

| Name | Type | Required | Description |
| --- | --- | --- | --- |
| `colors` | `integer` | no | rows; default: one per colour, with the tints of a global swatch in its row |
| `group` | `string` | no | read by the command beside its listed parameters |
| `limitTo` | `string` | no |  |
| `map` | `integer \| string` | no | read by the command beside its listed parameters |
| `method` | `"exact" \| "preserveTints" \| "scaleTints" \| "tintsShades" \| "hueShift"` | no |  |
| `preserve` | `object` | no | left out of the rows |
| `rename` | `string` | no | read by the command beside its listed parameters |

## Call through vector_run

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

The required parameters, with placeholders for their types: not a tested example. Optional: `colors`, `group`, `limitTo`, `map`, `method`, `preserve`, `rename`. vector_run answers the step’s result in `completed[i].result`.

## Result

| Name | Type | Required | Description |
| --- | --- | --- | --- |
| `map` | `any[]` | no |  |
| `method` | `string` | no |  |
| `preserved` | `string[]` | no |  |

```json
{
  "additionalProperties": true,
  "properties": {
    "map": {
      "type": "array"
    },
    "method": {
      "type": "string"
    },
    "preserved": {
      "items": {
        "type": "string"
      },
      "type": "array"
    }
  },
  "type": "object"
}
```

## Parameter schema

```json
{
  "additionalProperties": false,
  "properties": {
    "colors": {
      "description": "rows; default: one per colour, with the tints of a global swatch in its row",
      "type": "integer"
    },
    "group": {
      "description": "read by the command beside its listed parameters",
      "type": "string"
    },
    "limitTo": {
      "type": "string"
    },
    "map": {
      "description": "read by the command beside its listed parameters",
      "oneOf": [
        {
          "type": "integer"
        },
        {
          "type": "string"
        }
      ]
    },
    "method": {
      "enum": [
        "exact",
        "preserveTints",
        "scaleTints",
        "tintsShades",
        "hueShift"
      ],
      "type": "string"
    },
    "preserve": {
      "additionalProperties": true,
      "description": "left out of the rows",
      "properties": {
        "black": {
          "default": true,
          "type": "boolean"
        },
        "grays": {
          "default": false,
          "type": "boolean"
        },
        "white": {
          "default": true,
          "type": "boolean"
        }
      },
      "type": "object"
    },
    "rename": {
      "description": "read by the command beside its listed parameters",
      "type": "string"
    }
  },
  "returns": "{map: [{from: [keys, the row's colour first], to: key}], preserved: [keys], method}",
  "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).
