Last active
September 13, 2021 19:49
-
-
Save KevinGutowski/321a66cbdb22633b32058dd7124264b6 to your computer and use it in GitHub Desktop.
Update Figma Color Descriptions to include RGB
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
// 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