import getLuminance from './getLuminance' ; /**
 * Returns the contrast ratio between two colors based on
 * [W3's recommended equation for calculating contrast](http://www.w3.org/TR/WCAG20/#contrast-ratiodef).
 */ function getContrast ( color1 , color2 ) { const luminance1 = getLuminance ( color1 ) ; const luminance2 = getLuminance ( color2 ) ; return luminance1 > luminance2 ? ( luminance1 + 0.05 ) / ( luminance2 + 0.05 ) : ( luminance2 + 0.05 ) / ( luminance1 + 0.05 ) ; } export default getContrast ;