From c87d02a7cdbfa380836fc2212d189b1187348828 Mon Sep 17 00:00:00 2001 From: Bel Curcio Date: Tue, 2 Mar 2021 11:20:24 -0300 Subject: [PATCH] Now colors work with lighter colors --- lib/colors.ts | 1 + 1 file changed, 1 insertion(+) 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