We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Hi,
I need to know if a color is dark or light to display a text in black or white but it seems that is not worked if the color is an array:
const colors = ['#ffffff', '#ffffff', '#ffffff']; return Color(colors).isLight() ? '#000000' : '#ffffff';
The value returned is #ffffff
#ffffff
The text was updated successfully, but these errors were encountered:
Color() makes an instance of Color. To work with few colors need make own instance for each one.
Color()
const colors = ['#FFF', '#FFF', '#FFF']; const result = colors.map(color => Color(color).isLight() ? '#000' : '#FFF'); console.log(result); // [ '#000', '#000', '#000' ]
Sorry, something went wrong.
Not sure how I missed this. @vyushin is correct.
No branches or pull requests
Hi,
I need to know if a color is dark or light to display a text in black or white but it seems that is not worked if the color is an array:
The value returned is
#ffffff
The text was updated successfully, but these errors were encountered: