aboutsummaryrefslogtreecommitdiff
path: root/src/Utils.ts
diff options
context:
space:
mode:
authorSophie Zhang <sophie_zhang@brown.edu>2023-11-02 02:12:19 -0400
committerSophie Zhang <sophie_zhang@brown.edu>2023-11-02 02:12:19 -0400
commita1d00a36ef1afa97198a825bd25ebb4c5e598848 (patch)
treee0c0454c99938562132794333a22e490e3e37cb9 /src/Utils.ts
parent78d8261522c0079b0298613a856547a9ac96ef50 (diff)
parent84c15417f2247fc650a9f7b2c959479519bd3ebb (diff)
Merge branch 'master' into sophie-ai-images
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 b5ca53a33..330ca59f9 100644
--- a/src/Utils.ts
+++ b/src/Utils.ts
@@ -555,7 +555,7 @@ export function returnAll(): 'all' {
return 'all';
}
-export function returnNone() {
+export function returnNone(): 'none' {
return 'none';
}
@@ -758,7 +758,7 @@ export function DashColor(color: string) {
}
export function lightOrDark(color: any) {
- if (color === 'transparent') return Colors.DARK_GRAY;
+ if (color === 'transparent' || !color) 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();