Photo kit command

select.colorRange

Color Range…

Selects pixels of a color range (a sampled color, highlights, midtones, shadows, skin tones) with fuzziness.

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

Parameters

Parameters of select.colorRange
NameTypeRequiredDescription
backgroundColorstringnoThe background color the command uses, "#rrggbb", for this call only; the current background color by default.
coalescestringnoMerges consecutive edits with the same key into one undo step, as a slider drag or a typing session is one.
colorstringnolike #rrggbb; default foreground
colorsstring[]no
foregroundColorstringnoThe foreground color the command uses, "#rrggbb", for this call only; the current foreground color by default.
fuzzinessintegerno0 to 200; tones: 0..100 %=20
invertbooleanno
localizedbooleanno
mode"replace" | "add" | "subtract" | "intersect"no
order("+" | "-")[]noclick order of points and subtractPoints; default all points first
pointsnumber[][]noeyedropper samples
rangeintegerno0 to 100; % of the longer side
sampleAllLayersbooleanno
select"sampledColors" | "reds" | "yellows" | "greens" | "cyans" | "blues" | "magentas" | "highlights" | "midtones" | "shadows" | "outOfGamut"no
subtractPointsnumber[][]nominus eyedropper
tonalRangeanynolevel|[lo,hi] (shadows 65, highlights 190, midtones [105,150]); shadows 65, highlights 190, midtones [105,150]

Call through photo_run

text
photo_run {
  "path": "<file>.psd",
  "steps": [{ "command": "select.colorRange" }]
}

The required parameters, with placeholders for their types: not a tested example. Optional: backgroundColor, coalesce, color, colors, foregroundColor, fuzziness, invert, localized, mode, order, points, range, sampleAllLayers, select, subtractPoints, tonalRange. photo_run answers the step’s result in completed[i].result.

Result

Result of select.colorRange
NameTypeRequiredDescription
selectedbooleanno
Result JSON Schema
json
{
  "additionalProperties": true,
  "properties": {
    "selected": {
      "type": "boolean"
    }
  },
  "type": "object"
}

Parameter schema

json
{
  "additionalProperties": false,
  "properties": {
    "backgroundColor": {
      "description": "The background color the command uses, \"#rrggbb\", for this call only; the current background color by default.",
      "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": "like #rrggbb; default foreground",
      "type": "string"
    },
    "colors": {
      "items": {
        "description": "like #rrggbb",
        "type": "string"
      },
      "type": "array"
    },
    "foregroundColor": {
      "description": "The foreground color the command uses, \"#rrggbb\", for this call only; the current foreground color by default.",
      "type": "string"
    },
    "fuzziness": {
      "default": 40,
      "description": "0 to 200; tones: 0..100 %=20",
      "type": "integer"
    },
    "invert": {
      "default": false,
      "type": "boolean"
    },
    "localized": {
      "default": false,
      "type": "boolean"
    },
    "mode": {
      "default": "replace",
      "enum": [
        "replace",
        "add",
        "subtract",
        "intersect"
      ],
      "type": "string"
    },
    "order": {
      "description": "click order of points and subtractPoints; default all points first",
      "items": {
        "enum": [
          "+",
          "-"
        ],
        "type": "string"
      },
      "type": "array"
    },
    "points": {
      "description": "eyedropper samples",
      "items": {
        "items": {
          "type": "number"
        },
        "type": "array"
      },
      "type": "array"
    },
    "range": {
      "default": 100,
      "description": "0 to 100; % of the longer side",
      "type": "integer"
    },
    "sampleAllLayers": {
      "default": true,
      "type": "boolean"
    },
    "select": {
      "default": "sampledColors",
      "enum": [
        "sampledColors",
        "reds",
        "yellows",
        "greens",
        "cyans",
        "blues",
        "magentas",
        "highlights",
        "midtones",
        "shadows",
        "outOfGamut"
      ],
      "type": "string"
    },
    "subtractPoints": {
      "description": "minus eyedropper",
      "items": {
        "items": {
          "type": "number"
        },
        "type": "array"
      },
      "type": "array"
    },
    "tonalRange": {
      "description": "level|[lo,hi] (shadows 65, highlights 190, midtones [105,150]); shadows 65, highlights 190, midtones [105,150]"
    }
  },
  "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.