Last active
February 3, 2020 16:43
-
-
Save danhollick/f3e5f7e17245f42f04f975d9ab7721c0 to your computer and use it in GitHub Desktop.
Mocking up contrast test
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
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