Set fill
set_fillSet the fill color and opacity of specified SVG objects using hex, RGB, HSL, or named colors.
Instructions
Set the fill colour (and optional fill opacity) of one or more objects.
When to use: recolouring specific objects' fill (get the ids from find_objects). To change
every instance of a colour document-wide use replace_color; for a whole theme use
apply_palette; for the outline use set_stroke.
Key params: color accepts hex, rgb()/rgba()/hsl()/hsla(), a named colour, or a url(#id)
paint-server reference — a gradient/pattern in <defs>, e.g. an id from add_linear_gradient /
add_radial_gradient (optionally with a fallback colour: url(#id) red). External urls,
javascript:, and CSS-injection punctuation are rejected. opacity, if given, in [0, 1].
Return shape: EditResult — operation_id, snapshot_id, changed (false if the colour was
already present), before/after preview; the edit lands on the working copy only (reversible).
Example: set_fill(doc_id, ["logo"], "#3366cc")
Render and look before you trust this edit: render with render_preview (or live_render_view)
and inspect the result before relying on it; restore_snapshot reverts it if it is wrong.
Risk class: medium.
Input Schema
| Name | Required | Description | Default |
|---|---|---|---|
| color | Yes | ||
| doc_id | Yes | ||
| opacity | No | ||
| object_ids | Yes |
Output Schema
| Name | Required | Description | Default |
|---|---|---|---|
| doc_id | Yes | ||
| changed | Yes | ||
| summary | No | ||
| snapshot_id | Yes | ||
| operation_id | Yes | ||
| preview_after | No | ||
| preview_before | No |