Skip to main content
Sets the stroke (border) color and weight of a Figma node.

Parameters

nodeId
string
required
The ID of the node to modify
r
number
required
Red component (0-1 range)
g
number
required
Green component (0-1 range)
b
number
required
Blue component (0-1 range)
a
number
Alpha/transparency component (0-1 range). Defaults to 1 (fully opaque)
weight
number
Stroke weight in pixels. Defaults to 1
Figma uses RGBA values in the 0-1 range, not 0-255. For example, pure red is {r: 1, g: 0, b: 0}, not {r: 255, g: 0, b: 0}.

Response

Returns the name of the modified node and confirms the stroke color and weight.

Examples

Set solid black stroke with 2px weight

{
  "nodeId": "123:456",
  "r": 0,
  "g": 0,
  "b": 0,
  "a": 1,
  "weight": 2
}

Set semi-transparent green stroke

{
  "nodeId": "123:456",
  "r": 0,
  "g": 0.8,
  "b": 0.2,
  "a": 0.5,
  "weight": 3
}

Set default 1px red stroke

{
  "nodeId": "123:456",
  "r": 1,
  "g": 0,
  "b": 0
}

Build docs developers (and LLMs) love