Skip to content

Instantly share code, notes, and snippets.

@KevinGutowski
Last active September 13, 2021 19:49
Show Gist options
  • Save KevinGutowski/321a66cbdb22633b32058dd7124264b6 to your computer and use it in GitHub Desktop.
Save KevinGutowski/321a66cbdb22633b32058dd7124264b6 to your computer and use it in GitHub Desktop.
Update Figma Color Descriptions to include RGB
// Update color descriptions to include rgb code
let paintStyles = figma.getLocalPaintStyles()
paintStyles.forEach(paintStyle=>{
let color = paintStyle.paints[0].color
let description = `rgb(${(color.r*256).toFixed(0)},${(color.g*256).toFixed(0)},${(color.b*256).toFixed(0)})`
paintStyle.description = description
})
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment