Skip to content

Instantly share code, notes, and snippets.

@danhollick
Created February 4, 2020 09:19
Show Gist options
  • Save danhollick/862207e91eac3e5edeba324d0a8b6b3e to your computer and use it in GitHub Desktop.
Save danhollick/862207e91eac3e5edeba324d0a8b6b3e to your computer and use it in GitHub Desktop.
clean up listeners
figma.on('selectionchange', () => {
if (figma.currentPage.selection.length > 1) {
// assigning values from selection
calculateAndSendContrast(foregroundColor, foregroundAlpha, backgoundColor)
}
})
figma.ui.onmessage = msg => {
if (msg.type === 'swap') {
// swapping variable values
calculateAndSendContrast(foregroundColor, foregroundAlpha, backgoundColor)
}
}
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment