aboutsummaryrefslogtreecommitdiff
path: root/src/Utils.ts
diff options
context:
space:
mode:
authorbobzel <zzzman@gmail.com>2021-09-23 20:22:58 -0400
committerbobzel <zzzman@gmail.com>2021-09-23 20:22:58 -0400
commit815899626d82972ae56918487ee3ece11446d5a6 (patch)
tree6cbe1f0e4970c790795f37d03b607ff4b84deb32 /src/Utils.ts
parentb1be21398d396dd5c57d39563609b68ddc2f06a8 (diff)
minor fixes.
Diffstat (limited to 'src/Utils.ts')
-rw-r--r--src/Utils.ts2
1 files changed, 1 insertions, 1 deletions
diff --git a/src/Utils.ts b/src/Utils.ts
index e11f1154e..db33875ea 100644
--- a/src/Utils.ts
+++ b/src/Utils.ts
@@ -576,7 +576,7 @@ export function simulateMouseClick(element: Element | null | undefined, x: numbe
export function lightOrDark(color: any) {
const nonAlphaColor = color.startsWith("#") ? (color as string).substring(0, 7) :
color.startsWith("rgba") ? color.replace(/,.[^,]*\)/, ")").replace("rgba", "rgb") : color;
- const col = Color(nonAlphaColor).rgb();
+ const col = Color(nonAlphaColor.toLowerCase()).rgb();
const colsum = (col.red() + col.green() + col.blue());
if (colsum / col.alpha() > 400 || col.alpha() < 0.25) return Colors.DARK_GRAY;
else return Colors.WHITE;