Skip to content

This function calculates a linear gradient string given a node & fill from the Figma API (not plugin API)

Notifications You must be signed in to change notification settings

Nushaine/calculateLinearGradient-FigmaAPI

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

13 Commits
 
 
 
 

Repository files navigation

calculateLinearGradient-FigmaAPI

This function calculates a linear gradient string given a node & fill from the Figma API (not plugin API)

Example Usage

'component' is a node from the Figma API

component.fills.map((fill: any) => {
  if(fill.type == "GRADIENT_LINEAR" && fill.visible != false) {
    let gradientStr = createLinearGradient(fill, component)
  }
})

If not working, feel free to email me ([email protected]) for more assistance :)

P.S. This code snippet was copied from Unify. Unify converts your Figma components into production-ready code. Check it out here: https://www.useunify.app/

About

This function calculates a linear gradient string given a node & fill from the Figma API (not plugin API)

Resources

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published