From 4b6e16e29b50b492b0a8cbdf32414c7a626f68bd Mon Sep 17 00:00:00 2001 From: bobzel Date: Tue, 12 Apr 2022 11:00:01 -0400 Subject: changed lightOrDark for 'transparent' to return gray. --- src/Utils.ts | 1 + 1 file changed, 1 insertion(+) (limited to 'src') diff --git a/src/Utils.ts b/src/Utils.ts index b280badd7..77095005b 100644 --- a/src/Utils.ts +++ b/src/Utils.ts @@ -603,6 +603,7 @@ export function DashColor(color: string) { } export function lightOrDark(color: any) { + if (color === "transparent") return "gray"; const nonAlphaColor = color.startsWith("#") ? (color as string).substring(0, 7) : color.startsWith("rgba") ? color.replace(/,.[^,]*\)/, ")").replace("rgba", "rgb") : color; const col = DashColor(nonAlphaColor).rgb(); -- cgit v1.2.3-70-g09d2