Complete the code to create a frame in Figma.
const frame = figma.create[1]();In Figma's plugin API, createFrame() creates a new frame node.
Complete the code to set the width of a frame to 300 pixels.
frame.[1] = 300;
The width property sets the horizontal size of the frame in pixels.
Fix the error in the code to add a rectangle inside the frame.
const rect = figma.createRectangle();
frame.[1](rect);The correct method to add a child node in Figma is appendChild().
Fill both blanks to set the fill color of a rectangle to red.
rect.fills = [{ [1]: { r: 1, g: 0, b: 0 }, [2]: 1 }];The color property defines the RGB values, and opacity sets transparency.
Fill all three blanks to create a text node, set its content, and add it to the frame.
const text = figma.create[1](); text.characters = [2]; frame.[3](text);
Create a text node with createText(), set its characters, then add it to the frame with appendChild().
