style_set_categorized
Apply categorized styling to a vector layer by assigning colors to distinct field values, either automatically or with custom colors and labels.
Instructions
Style a vector layer with one color per distinct value of field.
Pass categories as an explicit list of {"value", "color", "label"} to
control colors/labels yourself. Omit it to auto-generate one category per
distinct value in the field, colored from color_ramp (a QGIS style
color ramp name, e.g. "Spectral" - the default if omitted).
Input Schema
| Name | Required | Description | Default |
|---|---|---|---|
| field | Yes | ||
| layer_id | Yes | ||
| categories | No | ||
| color_ramp | No |
Output Schema
| Name | Required | Description | Default |
|---|---|---|---|
No arguments | |||