packageDocumentation module internal export function getBestBWContrastColor ( hexColor ) { const r = parseInt ( hexColor . substr ( 1 , 2 ) , 16 ) ; const g = parseInt ( hexColor . substr ( 3 , 2 ) , 16 ) ; const b = parseInt ( hexColor . substr ( 5 , 2 ) , 16 ) ; const yiq = ( ( r * 299 ) + ( g * 587 ) + ( b * 114 ) ) / 1000 ; return ( yiq >= 128 ) ? "black" : "white" ; }