aboutsummaryrefslogtreecommitdiff
path: root/src/Utils.ts
diff options
context:
space:
mode:
authorbobzel <zzzman@gmail.com>2023-08-28 02:55:30 -0400
committerbobzel <zzzman@gmail.com>2023-08-28 02:55:30 -0400
commitf82baffbe4269deb257604a8203e10d727ff0a1b (patch)
treedacc2b2ef55f07b88a3f0cc8344862adb79c4227 /src/Utils.ts
parentae9ec0179e556f44bb9404f319d326321e73cb1f (diff)
trying to fix more colors
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();