Skip to main content

createEllipse

Creates a new ellipse. The behavior is similar to using the O shortcut followed by a click.

Signature

createEllipse(): EllipseNode

Remarks

By default, the new node has a default fill, width and height both at 100, and is parented under figma.currentPage.

Create a red, U-shaped half donut
const ellipse = figma.createEllipse()

// Move to (50, 50)
ellipse.x = 50
ellipse.y = 50

// Set size to 200 x 100
ellipse.resize(200, 100)

// Set solid red fill
ellipse.fills = [{ type: 'SOLID', color: { r: 1, g: 0, b: 0 } }]

// Arc from 0° to 180° clockwise
ellipse.arcData = {startingAngle: 0, endingAngle: Math.PI, innerRadius: 0.5}

On this page