set_gradient
Apply or update gradients on Figma nodes via Conduit, specifying type, color stops, and target areas (fill, stroke, or both) for precise design adjustments.
Instructions
Set a gradient on one or more nodes in Figma, either directly or by style variable.
Returns:
content: Array containing a text message with the updated node(s) ID(s) or a summary.
Input Schema
Name | Required | Description | Default |
---|---|---|---|
entries | Yes | One or more gradient set operations to perform. Can be a single object or an array. |
Input Schema (JSON Schema)
{
"$schema": "http://json-schema.org/draft-07/schema#",
"additionalProperties": false,
"properties": {
"entries": {
"anyOf": [
{
"additionalProperties": false,
"properties": {
"applyTo": {
"description": "Where to apply the gradient: \"FILL\", \"STROKE\", or \"BOTH\".",
"enum": [
"FILL",
"STROKE",
"BOTH"
],
"type": "string"
},
"gradientStyleId": {
"description": "The ID of the gradient style to apply.",
"maxLength": 100,
"minLength": 1,
"type": "string"
},
"gradientType": {
"description": "Type of gradient: \"LINEAR\", \"RADIAL\", \"ANGULAR\", or \"DIAMOND\".",
"enum": [
"LINEAR",
"RADIAL",
"ANGULAR",
"DIAMOND"
],
"type": "string"
},
"nodeId": {
"description": "The unique Figma node ID to update.",
"type": "string"
},
"stops": {
"description": "Array of color stops. Each stop is an object with position and color. Must contain 2 to 10 stops.",
"items": {
"additionalProperties": false,
"properties": {
"color": {
"description": "RGBA color array (4 numbers, each 0-1).",
"items": [
{
"description": "Red channel (0-1)",
"maximum": 1,
"minimum": 0,
"type": "number"
},
{
"description": "Green channel (0-1)",
"maximum": 1,
"minimum": 0,
"type": "number"
},
{
"description": "Blue channel (0-1)",
"maximum": 1,
"minimum": 0,
"type": "number"
},
{
"description": "Alpha channel (0-1)",
"maximum": 1,
"minimum": 0,
"type": "number"
}
],
"maxItems": 4,
"minItems": 4,
"type": "array"
},
"position": {
"description": "Position of the stop (0-1).",
"maximum": 1,
"minimum": 0,
"type": "number"
}
},
"required": [
"position",
"color"
],
"type": "object"
},
"maxItems": 10,
"minItems": 2,
"type": "array"
}
},
"required": [
"nodeId"
],
"type": "object"
},
{
"items": {
"$ref": "#/properties/entries/anyOf/0"
},
"maxItems": 100,
"minItems": 1,
"type": "array"
}
],
"description": "One or more gradient set operations to perform. Can be a single object or an array."
}
},
"required": [
"entries"
],
"type": "object"
}