aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorbobzel <zzzman@gmail.com>2022-04-12 11:00:01 -0400
committerbobzel <zzzman@gmail.com>2022-04-12 11:00:01 -0400
commit4b6e16e29b50b492b0a8cbdf32414c7a626f68bd (patch)
tree35a2f6f45caa7967c1f415b27e8a3ab5a16752b2
parente8938d5d7b889551c1d32bcf5385e369ed67cea5 (diff)
changed lightOrDark for 'transparent' to return gray.
-rw-r--r--src/Utils.ts1
1 files changed, 1 insertions, 0 deletions
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();