Complete the code to create a new frame in Figma.
const frame = figma.create[1]();The createFrame() method creates a new frame in Figma, which is a container for design elements.
Complete the code to set the fill color of a shape to red.
shape.fills = [{ type: 'SOLID', color: { r: [1], g: 0, b: 0 } }];In Figma, color values range from 0 to 1. To set red fully, r should be 1.
Fix the error in the code to append a child node to a frame.
frame.[1](child);The correct method to add a child node in Figma is appendChild().
Fill both blanks to create a text node and set its characters.
const text = figma.create[1](); text.[2] = 'Hello Figma!';
You create a text node with createText() and set its content using the characters property.
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] = 50; figma.currentPage.appendChild(rect);
Create a rectangle with createRectangle(), set its width and height, then add it to the page.
