Created
November 7, 2020 13:16
-
-
Save karenying/bb68f3ee54723a890be2dd4b526c2956 to your computer and use it in GitHub Desktop.
This file contains 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
return ( | |
<div | |
className='colorbox-container' | |
style={{ backgroundColor: `#${backgroundHex}`, color: `#${textColor}` }} | |
> | |
{`#${backgroundHex}`} | |
<br /> | |
{`Contrast ratio: ${backgroundColor | |
.contrastRatioWith(textColor) | |
.toFixed(2)}`} | |
</div> |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment