aboutsummaryrefslogtreecommitdiff
path: root/src/Utils.ts
diff options
context:
space:
mode:
Diffstat (limited to 'src/Utils.ts')
-rw-r--r--src/Utils.ts4
1 files changed, 2 insertions, 2 deletions
diff --git a/src/Utils.ts b/src/Utils.ts
index 9a94694a2..29824ba94 100644
--- a/src/Utils.ts
+++ b/src/Utils.ts
@@ -758,8 +758,8 @@ export function DashColor(color: string) {
}
export function lightOrDark(color: any) {
- if (color === 'transparent') return 'gray';
- if (color.startsWith?.('linear')) return 'black';
+ if (color === 'transparent') return Colors.DARK_GRAY;
+ if (color.startsWith?.('linear')) return Colors.BLACK;
const nonAlphaColor = color.startsWith('#') ? (color as string).substring(0, 7) : color.startsWith('rgba') ? color.replace(/,.[^,]*\)/, ')').replace('rgba', 'rgb') : color;
const col = DashColor(nonAlphaColor).rgb();
const colsum = col.red() + col.green() + col.blue();