Complete the code to create a new frame in Figma.
const frame = figma.create[1]();In Figma plugin API, createFrame() creates a new frame node.
Complete the code to set the fill color of a rectangle in Figma.
rect.fills = [{ type: 'SOLID', color: { r: 1, g: 0, [1]: 0 } }];The color object uses r, g, and b for red, green, and blue values.
Fix the error in the code to load a Figma document by key.
const file = await figma.client.[1]('file_key');
The Figma API client uses getFile to retrieve a file by its key.
Fill both blanks to create a text node and set its font size.
const text = figma.create[1](); await figma.loadFontAsync({ family: 'Roboto', style: 'Regular' }); text.[2] = 24;
You create a text node with createText() and set its font size with fontSize.
Fill all three blanks to create a rectangle, set its size, and add it to the current page.
const rect = figma.create[1](); rect.[2] = 100; rect.[3] = 200; figma.currentPage.[4](rect);
Create a rectangle with createRectangle(), set width and height, then add it to the page with appendChild().
