Complete the code to draw a straight line using the line tool.
line = figma.create[1]()Use createLine() to create a straight line in Figma.
Complete the code to set the stroke color of the line to red.
line.strokes = [{ type: 'SOLID', color: { r: 1, g: [1], b: 0 } }]To get pure red, green and blue values should be 0.
Fix the error in the code to add an arrowhead at the end of the line.
line.strokeCaps = ['NONE', '[1]']
Use line.strokeCaps = ['NONE', 'ARROW_EQUILATERAL'] to add an arrowhead at the end of a line.
Fill both blanks to create a dashed arrow line with stroke weight 3.
line.strokeWeight = [1] line.dashPattern = [[2]]
Stroke weight 3 makes the line thicker. Dash pattern [5] creates dashes of length 5.
Fill all three blanks to create a blue arrow line from (10, 20) to (100, 200).
line.strokeWeight = [1] line.strokes = [{ type: 'SOLID', color: { r: 0, g: [2], b: [3] } }] line.vectorPaths = [{ windingRule: 'NONZERO', data: 'M10 20 L100 200' }] line.strokeCaps = ['NONE', 'ARROW_EQUILATERAL']
Stroke weight 2 is a good thickness. Blue color means red=0, green=0, blue=1.
