set_style
Set style fields on a layer. Only the fields you pass are changed; omit a field to leave it untouched. Covers border/radius/shadow (including borderAlign — inner|center|outer border position) plus image-only fields: fit (stretch|cover|contain), anchorX/anchorY (0..1, where the source anchors when cropping/letterboxing under cover/contain), tintColor (#rrggbb) + tintStrength (0..1) for a colour overlay painted source-atop, and alphaMask (linear gradient — see below) for a multiplicative alpha fade across the layer.
Input Schema
| Name | Required | Description | Default |
|---|---|---|---|
| fit | No | Fit mode (image + video layers). Default: stretch for image layers, cover for video layers. | |
| anchorX | No | Object-position X (0..1). 0=left, 1=right, 0.5=centre. Only meaningful with fit=cover|contain. | |
| anchorY | No | Object-position Y (0..1). 0=top, 1=bottom, 0.5=centre. Only meaningful with fit=cover|contain. | |
| alphaMask | No | Linear alpha-mask gradient (image layers). Multiplies the layer's alpha along a gradient line — used to fade a layer out partway across (the front half of a 'sandwich' covering text below it). Object: { type: 'linear', angle: number (deg, CSS-style; 0=to top, 90=to right, 180=to bottom, 270=to left), stops: [{offset:0..1, alpha:0..1}, ...] (≥2 stops, ordered by offset) }. Pass null to clear. | |
| boxShadow | No | CSS box-shadow string, e.g. "0 4px 12px rgba(0,0,0,0.5)". Pass an empty string "" or null to REMOVE the shadow. | |
| elementId | Yes | ||
| projectId | Yes | Opaque project id (a v4 UUID, from list_projects/create_project). Selects which existing project this call mutates. | |
| tintColor | No | #rrggbb tint colour painted source-atop over the image (image layers only). | |
| blend_mode | No | Photoshop-style layer blend mode (Canvas globalCompositeOperation). 'normal' is the default. Applies to every layer kind; allowed on group.<id> too (the only set_style field that is). | |
| chroma_key | No | Green-screen key (video / image layers). Makes pixels near `color` transparent at render time so layers below show through. Object: { color: '#rrggbb' (default '#00ff00'), similarity: 0..1 (match radius, default 0.4), smoothness: 0..1 (edge feather, default 0.1) }. Pass null to clear. | |
| borderAlign | No | Where the border sits relative to the layer's edge (design-tool "border position"). "inner" (default) draws the band INSIDE the box so it eats into the content; "outer" draws it entirely OUTSIDE so it frames the content without covering it; "center" straddles the edge 50/50. Rectangular boxes (image/video/text) only — shapes always stroke centred on their silhouette and ignore it. | |
| borderColor | No | #rrggbb. | |
| borderWidth | No | ||
| borderRadius | No | ||
| tintStrength | No | Tint blend strength 0..1. 0=no tint, 1=image silhouette filled with tintColor. Default 0 (no tint). |