Hi,
I am trying to add a stroke to a rectangle component but it does not seem to work. What I am trying to do is this:
const rect = figma.createRectangle(); rect.x = xmin; rect.y = ymin; rect.resize(xmax - xmin, ymax - ymin); rect.cornerRadius = 5; const fills = clone(rect.fills); fills[0].opacity = 0; rect.fills = fills; const strokes = clone(rect.strokes); strokes[0].color = {r: 0, g: 0, b: 0}; rect.strokes = strokes; rect.strokeWeight = 5; rect.strokeAlign = "CENTER"; frame.appendChild(rect);
I understand that a newly created rectangle does not have strokes thus the strokes array is empty, so how do I create a strokes component and apply it to my rectangle?
Thanks