Skip to content

Instantly share code, notes, and snippets.

@danhollick
Last active February 4, 2020 09:01
Show Gist options
  • Save danhollick/25bf7fa2d47d4f8fdf1de104f11d68ce to your computer and use it in GitHub Desktop.
Save danhollick/25bf7fa2d47d4f8fdf1de104f11d68ce to your computer and use it in GitHub Desktop.
swap values
//..
let foregroundAlpha
let backgroundAlpha
//...
if (msg.type === 'swap') {
if (figma.currentPage.selection.length > 1) {
;[foregroundColor, backgoundColor, foregroundAlpha, backgroundAlpha] = [
backgoundColor,
foregroundColor,
backgroundAlpha,
foregroundAlpha,
]
const contrast = calculateContrast(foregroundColor, foregroundAlpha, backgoundColor)
sendContrastInfo(contrast, foregroundColor, backgoundColor)
}
}
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment