aboutsummaryrefslogtreecommitdiff
path: root/src/Utils.ts
diff options
context:
space:
mode:
authorsrichman333 <sarah_n_richman@brown.edu>2023-11-06 18:36:58 -0500
committersrichman333 <sarah_n_richman@brown.edu>2023-11-06 18:36:58 -0500
commit1b412d402c77a2aae82cf86b1f6a23f8a4f82caf (patch)
tree7ebd22eeade12099d1d891d9f9b264f02956ad4a /src/Utils.ts
parent7163062edec37cef9dd9ae6c123d987e83837463 (diff)
parenta4e3b645317c4589cf49f8007f6e6b57cf2c12d3 (diff)
Merge branch 'master' into dataViz-annotations
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();