UNPKG

@shopify/polaris

Version:

Shopify’s product component library

12 lines (10 loc) 224 B
// implements: https://www.w3.org/WAI/ER/WD-AERT/#color-contrast function isLight({ red, green, blue }) { var contrast = (red * 299 + green * 587 + blue * 114) / 1000; return contrast > 125; } export { isLight };