Skip to content

Instantly share code, notes, and snippets.

@nblackburn
Created May 29, 2019 18:20
Show Gist options
  • Save nblackburn/1e8fb7932f624485534ff7aa2c44972a to your computer and use it in GitHub Desktop.
Save nblackburn/1e8fb7932f624485534ff7aa2c44972a to your computer and use it in GitHub Desktop.
module.exports = (foreground, background) => {
const l1 = Math.max(foreground, background);
const l2 = Math.min(foreground, background);
return (l1 + 0.05) / (l2 + 0.05);
};
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment