MCPcopy
hub / github.com/figma/plugin-samples / startPluginWithParameters

Function startPluginWithParameters

svg-inserter/code.ts:55–67  ·  view source on GitHub ↗
(parameters: ParameterValues)

Source from the content-addressed store, hash-verified

53
54// Start the plugin with parameters
55function startPluginWithParameters(parameters: ParameterValues) {
56 const icon = parameters.icon
57 const size = parameters.size
58
59 // Color is an optional parameter, so it is possibly undefined.
60 const color = parameters.color ?? 'black'
61
62 const processedSvg = icon.replace(/\$size\$/g, size).replace(/\$color\$/g, color)
63
64 figma.createNodeFromSvg(processSVG({icon, size, color}))
65
66 figma.closePlugin()
67}

Callers 1

code.tsFile · 0.70

Calls 1

processSVGFunction · 0.85

Tested by

no test coverage detected