We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
1 parent 07b901a commit f09756fCopy full SHA for f09756f
src/utils.ts
@@ -112,7 +112,7 @@ export function computeColor(color: string): string {
112
113
export function computeTextColor(backgroundColor: string): string {
114
const colorObj = new TinyColor(backgroundColor);
115
- if (colorObj.isValid && colorObj.getLuminance() > 0.5) {
+ if (colorObj.isValid && colorObj.isLight()) {
116
return '#000'; // bright colors - black font
117
} else {
118
return '#fff'; // dark colors - white font
0 commit comments