diff --git a/lib/colors.ts b/lib/colors.ts index f9c0b5b0b..139cda23d 100644 --- a/lib/colors.ts +++ b/lib/colors.ts @@ -194,6 +194,7 @@ const colorMap: Record = { } export function isDark(color: string = ''): boolean { + color = color.toLowerCase() // Equation from http://24ways.org/2010/calculating-color-contrast let rgb = colorMap[color] ? hexToRgb(colorMap[color]) : hexToRgb(color) const res = (rgb[0] * 299 + rgb[1] * 587 + rgb[2] * 114) / 1000