Created
February 4, 2020 13:03
-
-
Save danhollick/92898e0abfd1cc717f1f5c503fcdff2f to your computer and use it in GitHub Desktop.
This file contains hidden or 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
figma.on('selectionchange', () => { | |
const fills = findFills(figma.currentPage.selection) | |
if (fills.length > 1) { | |
// ... | |
} | |
if (fills.length === 1) { | |
const fills = findFills(figma.currentPage.selection) | |
foregroundColor = getRGB(fills[0].color) | |
foregroundAlpha = fills[0].opacity | |
calculateAndSendContrast(foregroundColor, foregroundAlpha, backgoundColor) | |
} | |
}) |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment