Set stroke
set_strokeSet the stroke color, width, or opacity of selected objects to style their outline or border.
Instructions
Set the stroke colour, width, and/or opacity of one or more objects.
When to use: styling an object's outline/border. For the interior use set_fill; to turn a
stroke into a filled outline path use stroke_to_path.
Key params: at least one of color, width, opacity must be supplied. color accepts a
colour OR a url(#id) paint-server reference (gradient/pattern in <defs>, optionally with a
fallback colour); width is a CSS length (number + optional unit); opacity must be in [0, 1].
External urls, javascript:, and CSS-injection punctuation are rejected.
Return shape: EditResult — operation_id, snapshot_id, changed, before/after preview; the
edit lands on the working copy only (reversible).
Example: set_stroke(doc_id, ["border"], color="#000", width="2")
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 | No | ||
| width | No | ||
| 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 |