diff options
author | srichman333 <sarah_n_richman@brown.edu> | 2023-11-06 18:36:58 -0500 |
---|---|---|
committer | srichman333 <sarah_n_richman@brown.edu> | 2023-11-06 18:36:58 -0500 |
commit | 1b412d402c77a2aae82cf86b1f6a23f8a4f82caf (patch) | |
tree | 7ebd22eeade12099d1d891d9f9b264f02956ad4a /src/Utils.ts | |
parent | 7163062edec37cef9dd9ae6c123d987e83837463 (diff) | |
parent | a4e3b645317c4589cf49f8007f6e6b57cf2c12d3 (diff) |
Merge branch 'master' into dataViz-annotations
Diffstat (limited to 'src/Utils.ts')
-rw-r--r-- | src/Utils.ts | 4 |
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(); |