Skip to content

Instantly share code, notes, and snippets.

@danhollick
Last active February 3, 2020 16:43
Show Gist options
  • Save danhollick/f3e5f7e17245f42f04f975d9ab7721c0 to your computer and use it in GitHub Desktop.
Save danhollick/f3e5f7e17245f42f04f975d9ab7721c0 to your computer and use it in GitHub Desktop.
Mocking up contrast test
function calculateLuminance(color) {
//just return 1 for now
return 1
}
function calculateContrast(foreground, background) {
console.log(foreground, background)
const foregroundLuminance = calculateLuminance(foreground)
const backgroundLuminance = calculateLuminance(background)
return foregroundLuminance / backgroundLuminance
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment