set_gradient_fill
Apply linear, radial, angular, or diamond gradient fills to Figma nodes, replacing existing fills and using at least two sorted color stops.
Instructions
Apply a gradient fill to a Figma node. Supports LINEAR, RADIAL, ANGULAR (conic), and DIAMOND types. Replaces any existing fills. Stops must be sorted by position (0 → 1).
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>",
"stops": "<stops>"
},
"name": "set_gradient_fill"
}
}Input Schema
| Name | Required | Description | Default |
|---|---|---|---|
| type | No | Gradient type | LINEAR |
| angle | No | Rotation in degrees — 0 = top→bottom, 90 = left→right (LINEAR and ANGULAR) | |
| stops | Yes | At least 2 colour stops, sorted by position 0→1 | |
| center | No | Focal point [cx, cy] in 0–1 node-relative coordinates (RADIAL and DIAMOND, default [0.5, 0.5]) | |
| nodeId | Yes | Figma node ID | |
| gradientTransform | No | Raw 2×3 affine gradientTransform matrix — overrides angle/center when provided |