figma_apply_shader
Apply or edit a shader on a Figma node's fills, strokes, or effects by setting properties, colors, and variable bindings, or replace and reorder existing shaders.
Instructions
Apply a shader to a node's fills, strokes or effects, or change the properties of one already applied. Set properties by name (e.g. {turbulence: 40, cloudColor: '#E8F4FF'}); names, types and defaults come from figma_list_shaders. Colors take hex strings or {r,g,b,a}, and any property can bind a variable with {variableId}. Pass index to change a shader already in that list; without index the shader is added on top (or replaces the list with replace: true). Fill shaders go on fills or strokes; effect shaders go on effects. Unknown property names change nothing and list the valid ones. Requires Desktop Bridge.
Input Schema
| Name | Required | Description | Default |
|---|---|---|---|
| index | No | Change the shader at this position in the target list instead of adding one | |
| nodeId | Yes | ||
| target | No | fills | |
| fileKey | No | Local Mode only. Run against this specific connected file instead of the active file. Get connected fileKeys from figma_list_open_files. Rejected in Cloud Mode, which pairs with a single plugin instance. | |
| opacity | No | Fills and strokes only | |
| replace | No | Replace everything in the target list with this shader | |
| visible | No | ||
| shaderId | No | Shader id from figma_list_shaders. Optional when index points at a shader already applied | |
| blendMode | No | Fills and strokes only | |
| properties | No | Property values by name (or key) |