set_gradient
Apply a gradient fill to a Figma node, replacing all existing fills. Supports linear, radial, angular, and diamond gradients with customizable color stops and optional transform matrix.
Instructions
Set a gradient fill on a node in Figma. Supports linear, radial, angular, and diamond gradients. Replaces all existing fills (same behavior as set_fill_color).
Tool call template
Replace each placeholder with a value matching the input schema. Only required parameters are included; add optional parameters as needed.
{
"id": 1,
"jsonrpc": "2.0",
"method": "tools/call",
"params": {
"arguments": {
"nodeId": "<nodeId>",
"type": "<type>",
"stops": "<stops>"
},
"name": "set_gradient"
}
}Input Schema
| Name | Required | Description | Default |
|---|---|---|---|
| nodeId | Yes | The ID of the node to modify | |
| type | Yes | Gradient type | |
| stops | Yes | Array of gradient color stops (minimum 2) | |
| gradientTransform | No | 2x3 affine transform matrix [[a,b,tx],[c,d,ty]]. Defaults to left-to-right linear: [[1,0,0],[0,1,0]] |