bind_variable_to_paint
Bind a COLOR variable to a solid fill/stroke paint on a Figma node, enabling design-token coloring. Remove the binding by passing null. Target fills or strokes at a specific paint index.
Instructions
Bind a COLOR variable to a SOLID fill or stroke paint (the design-token way to colour a node) — or unbind by passing variableId: null. Figma stores fill/stroke colour bindings on the paint, not the node, so this is separate from bind_variable_to_node (which covers scalar fields like width / padding / radius). target is fills (default) or strokes; index selects which paint (default 0). The paint at that index must be SOLID. Returns { ok, nodeId }.
Input Schema
| Name | Required | Description | Default |
|---|---|---|---|
| index | No | Index of the paint within the list (default 0) | |
| nodeId | Yes | Node whose fill/stroke paint to bind | |
| target | No | Which paint list to bind on (default fills) | |
| variableId | Yes | COLOR variable id to bind, or null to remove the binding |