Set opacity
set_opacityAdjust the overall transparency of SVG objects by setting element-level opacity, affecting both fill and stroke simultaneously. Use opacity values between 0 and 1 for full control.
Instructions
Set the element-level opacity of one or more objects.
When to use: making whole objects more/less transparent. For fill-only or stroke-only opacity
use set_fill / set_stroke with their opacity argument instead.
Key params: opacity must be in [0, 1] (this is the element opacity, affecting fill AND
stroke together).
Return shape: EditResult — operation_id, snapshot_id, changed, before/after preview; the
edit lands on the working copy only (reversible).
Example: set_opacity(doc_id, ["overlay"], 0.5)
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 |
|---|---|---|---|
| doc_id | Yes | ||
| opacity | Yes | ||
| 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 |